python-openapi / openapi-core

Openapi-core is a Python library that adds client-side and server-side support for the OpenAPI v3.0 and OpenAPI v3.1 specification.
BSD 3-Clause "New" or "Revised" License
299 stars 133 forks source link

0.16.5: pytest is failing in few units #525

Closed kloczek closed 1 year ago

kloczek commented 1 year ago

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

Here is pytest output:

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-openapi-core-0.16.5-3.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-openapi-core-0.16.5-3.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' ==================================================================================== test session starts ==================================================================================== platform linux -- Python 3.8.16, pytest-7.2.1, pluggy-1.0.0 rootdir: /home/tkloczko/rpmbuild/BUILD/openapi-core-0.16.5, configfile: pyproject.toml plugins: anyio-3.6.2, flake8-1.1.1 collected 742 items tests/integration/contrib/django/test_django_project.py Bad Request: /v1/pets ..Bad Request: /v1/pets .Bad Request: /v1/pets .Unsupported Media Type: /v1/pets .Bad Request: /v1/pets ...Invalid HTTP_HOST header: 'testserver'. You may need to add 'testserver' to ALLOWED_HOSTS. Bad Request: /v1/pets/12 .Forbidden: /v1/pets/12 .Method Not Allowed: /v1/pets/12 ... tests/integration/contrib/falcon/test_falcon_project.py ............. tests/integration/contrib/flask/test_flask_decorator.py ...... tests/integration/contrib/flask/test_flask_validator.py . tests/integration/contrib/flask/test_flask_views.py ....... tests/integration/contrib/requests/test_requests_validation.py ... tests/integration/contrib/starlette/test_starlette_validation.py .. tests/integration/contrib/werkzeug/test_werkzeug_validation.py ... tests/integration/schema/test_empty.py . tests/integration/schema/test_link_spec.py .... tests/integration/schema/test_path_params.py .. tests/integration/schema/test_spec.py .. tests/integration/validation/test_minimal.py ............................................................ tests/integration/validation/test_petstore.py ..................................... tests/integration/validation/test_read_only_write_only.py .... tests/integration/validation/test_security_override.py ..... tests/integration/validation/test_validators.py ............................ tests/unit/test_util.py ................. tests/unit/casting/test_schema_casters.py .... tests/unit/contrib/django/test_django.py ...... tests/unit/contrib/flask/test_flask_requests.py ... tests/unit/contrib/flask/test_flask_responses.py . tests/unit/contrib/requests/test_requests_requests.py ... tests/unit/contrib/requests/test_requests_responses.py . tests/unit/deserializing/test_media_types_deserializers.py ......... tests/unit/deserializing/test_parameters_deserializers.py ... tests/unit/extensions/test_factories.py .. tests/unit/schema/test_schema_parameters.py ..................................................................................................................................................... tests/unit/security/test_providers.py ......... tests/unit/templating/test_media_types_finders.py .... tests/unit/templating/test_paths_finders.py X..x..x...........X..x..x........... tests/unit/templating/test_responses_finders.py ... tests/unit/templating/test_templating_util.py .. tests/unit/unmarshalling/test_unmarshal.py ....................................................................x......................... tests/unit/unmarshalling/test_validate.py .........................................................................................F.........F.......F......FFFF................................................................................... tests/unit/validation/test_request_shortcuts.py .. tests/unit/validation/test_response_shortcuts.py .. ========================================================================================= FAILURES ========================================================================================== _________________________________________________________________ TestSchemaValidate.test_string_format_date_invalid[true] __________________________________________________________________ self = , value = b'true' validator_factory = .create_validator at 0x7fdf783ea310> @pytest.mark.parametrize( "value", [ b"true", "test", False, 1, 3.14, [1, 3], datetime.datetime(1989, 1, 2), ], ) def test_string_format_date_invalid(self, value, validator_factory): schema = { "type": "string", "format": "date", } spec = Spec.from_dict(schema) with pytest.raises(InvalidSchemaValue): > validator_factory(spec).validate(value) E Failed: DID NOT RAISE schema = {'format': 'date', 'type': 'string'} self = spec = Spec('') validator_factory = .create_validator at 0x7fdf783ea310> value = b'true' tests/unit/unmarshalling/test_validate.py:404: Failed _________________________________________________________________ TestSchemaValidate.test_string_format_uuid_invalid[true0] _________________________________________________________________ self = , value = b'true' validator_factory = .create_validator at 0x7fdf783eaf70> @pytest.mark.parametrize( "value", [ b"true", "true", False, 1, 3.14, [1, 3], datetime.date(2018, 1, 2), datetime.datetime(2018, 1, 2, 23, 59, 59), ], ) def test_string_format_uuid_invalid(self, value, validator_factory): schema = { "type": "string", "format": "uuid", } spec = Spec.from_dict(schema) with pytest.raises(InvalidSchemaValue): > validator_factory(spec).validate(value) E Failed: DID NOT RAISE schema = {'format': 'uuid', 'type': 'string'} self = spec = Spec('') validator_factory = .create_validator at 0x7fdf783eaf70> value = b'true' tests/unit/unmarshalling/test_validate.py:462: Failed _______________________________________________________________ TestSchemaValidate.test_string_format_datetime_invalid[true0] _______________________________________________________________ self = , value = b'true' validator_factory = .create_validator at 0x7fdf783ea790> @pytest.mark.parametrize( "value", [ b"true", "true", False, 1, 3.14, [1, 3], "1989-01-02", ], ) def test_string_format_datetime_invalid(self, value, validator_factory): schema = { "type": "string", "format": "date-time", } spec = Spec.from_dict(schema) with pytest.raises(InvalidSchemaValue): > validator_factory(spec).validate(value) E Failed: DID NOT RAISE schema = {'format': 'date-time', 'type': 'string'} self = spec = Spec('') validator_factory = .create_validator at 0x7fdf783ea790> value = b'true' tests/unit/unmarshalling/test_validate.py:484: Failed ____________________________________________________ TestSchemaValidate.test_string_format_datetime_strict_rfc3339[1989-01-02T00:00:00Z] ____________________________________________________ args = (,) keywargs = {'validator_factory': .create_validator at 0x7fdf7831c4c0>, 'value': '1989-01-02T00:00:00Z'} @wraps(func) def patched(*args, **keywargs): > with self.decoration_helper(patched, args, keywargs) as (newargs, newkeywargs): args = (,) func = keywargs = {'validator_factory': .create_validator at 0x7fdf7831c4c0>, 'value': '1989-01-02T00:00:00Z'} patched = self = /usr/lib64/python3.8/unittest/mock.py:1322: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.8/contextlib.py:113: in __enter__ return next(self.gen) self = /usr/lib64/python3.8/unittest/mock.py:1304: in decoration_helper arg = exit_stack.enter_context(patching) args = (,) exit_stack = extra_args = [] keywargs = {'validator_factory': .create_validator at 0x7fdf7831c4c0>, 'value': '1989-01-02T00:00:00Z'} patched = patching = self = /usr/lib64/python3.8/contextlib.py:425: in enter_context result = _cm_type.__enter__(cm) _cm_type = _exit = cm = self = /usr/lib64/python3.8/unittest/mock.py:1393: in __enter__ original, local = self.get_original() autospec = None kwargs = {} new = False new_callable = None self = spec = None spec_set = None _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def get_original(self): target = self.getter() name = self.attribute original = DEFAULT local = False try: original = target.__dict__[name] except (AttributeError, KeyError): original = getattr(target, name, DEFAULT) else: local = True if name in _builtins and isinstance(target, ModuleType): self.create = True if not self.create and original is DEFAULT: > raise AttributeError( "%s does not have the attribute %r" % (target, name) ) E AttributeError: does not have the attribute 'DATETIME_HAS_ISODATE' local = False name = 'DATETIME_HAS_ISODATE' original = sentinel.DEFAULT self = target = /usr/lib64/python3.8/unittest/mock.py:1366: AttributeError ____________________________________________________ TestSchemaValidate.test_string_format_datetime_strict_rfc3339[2018-01-02T23:59:59Z] ____________________________________________________ args = (,) keywargs = {'validator_factory': .create_validator at 0x7fdf7831c8b0>, 'value': '2018-01-02T23:59:59Z'} @wraps(func) def patched(*args, **keywargs): > with self.decoration_helper(patched, args, keywargs) as (newargs, newkeywargs): args = (,) func = keywargs = {'validator_factory': .create_validator at 0x7fdf7831c8b0>, 'value': '2018-01-02T23:59:59Z'} patched = self = /usr/lib64/python3.8/unittest/mock.py:1322: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.8/contextlib.py:113: in __enter__ return next(self.gen) self = /usr/lib64/python3.8/unittest/mock.py:1304: in decoration_helper arg = exit_stack.enter_context(patching) args = (,) exit_stack = extra_args = [] keywargs = {'validator_factory': .create_validator at 0x7fdf7831c8b0>, 'value': '2018-01-02T23:59:59Z'} patched = patching = self = /usr/lib64/python3.8/contextlib.py:425: in enter_context result = _cm_type.__enter__(cm) _cm_type = _exit = cm = self = /usr/lib64/python3.8/unittest/mock.py:1393: in __enter__ original, local = self.get_original() autospec = None kwargs = {} new = False new_callable = None self = spec = None spec_set = None _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def get_original(self): target = self.getter() name = self.attribute original = DEFAULT local = False try: original = target.__dict__[name] except (AttributeError, KeyError): original = getattr(target, name, DEFAULT) else: local = True if name in _builtins and isinstance(target, ModuleType): self.create = True if not self.create and original is DEFAULT: > raise AttributeError( "%s does not have the attribute %r" % (target, name) ) E AttributeError: does not have the attribute 'DATETIME_HAS_ISODATE' local = False name = 'DATETIME_HAS_ISODATE' original = sentinel.DEFAULT self = target = /usr/lib64/python3.8/unittest/mock.py:1366: AttributeError _______________________________________________________ TestSchemaValidate.test_string_format_datetime_isodate[1989-01-02T00:00:00Z] ________________________________________________________ args = (,) keywargs = {'validator_factory': .create_validator at 0x7fdf7831c820>, 'value': '1989-01-02T00:00:00Z'} @wraps(func) def patched(*args, **keywargs): > with self.decoration_helper(patched, args, keywargs) as (newargs, newkeywargs): args = (,) func = keywargs = {'validator_factory': .create_validator at 0x7fdf7831c820>, 'value': '1989-01-02T00:00:00Z'} patched = self = /usr/lib64/python3.8/unittest/mock.py:1322: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.8/contextlib.py:113: in __enter__ return next(self.gen) self = /usr/lib64/python3.8/unittest/mock.py:1304: in decoration_helper arg = exit_stack.enter_context(patching) args = (,) exit_stack = extra_args = [] keywargs = {'validator_factory': .create_validator at 0x7fdf7831c820>, 'value': '1989-01-02T00:00:00Z'} patched = patching = self = /usr/lib64/python3.8/contextlib.py:425: in enter_context result = _cm_type.__enter__(cm) _cm_type = _exit = cm = self = /usr/lib64/python3.8/unittest/mock.py:1393: in __enter__ original, local = self.get_original() autospec = None kwargs = {} new = True new_callable = None self = spec = None spec_set = None _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def get_original(self): target = self.getter() name = self.attribute original = DEFAULT local = False try: original = target.__dict__[name] except (AttributeError, KeyError): original = getattr(target, name, DEFAULT) else: local = True if name in _builtins and isinstance(target, ModuleType): self.create = True if not self.create and original is DEFAULT: > raise AttributeError( "%s does not have the attribute %r" % (target, name) ) E AttributeError: does not have the attribute 'DATETIME_HAS_ISODATE' local = False name = 'DATETIME_HAS_ISODATE' original = sentinel.DEFAULT self = target = /usr/lib64/python3.8/unittest/mock.py:1366: AttributeError _______________________________________________________ TestSchemaValidate.test_string_format_datetime_isodate[2018-01-02T23:59:59Z] ________________________________________________________ args = (,) keywargs = {'validator_factory': .create_validator at 0x7fdf7831c310>, 'value': '2018-01-02T23:59:59Z'} @wraps(func) def patched(*args, **keywargs): > with self.decoration_helper(patched, args, keywargs) as (newargs, newkeywargs): args = (,) func = keywargs = {'validator_factory': .create_validator at 0x7fdf7831c310>, 'value': '2018-01-02T23:59:59Z'} patched = self = /usr/lib64/python3.8/unittest/mock.py:1322: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.8/contextlib.py:113: in __enter__ return next(self.gen) self = /usr/lib64/python3.8/unittest/mock.py:1304: in decoration_helper arg = exit_stack.enter_context(patching) args = (,) exit_stack = extra_args = [] keywargs = {'validator_factory': .create_validator at 0x7fdf7831c310>, 'value': '2018-01-02T23:59:59Z'} patched = patching = self = /usr/lib64/python3.8/contextlib.py:425: in enter_context result = _cm_type.__enter__(cm) _cm_type = _exit = cm = self = /usr/lib64/python3.8/unittest/mock.py:1393: in __enter__ original, local = self.get_original() autospec = None kwargs = {} new = True new_callable = None self = spec = None spec_set = None _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def get_original(self): target = self.getter() name = self.attribute original = DEFAULT local = False try: original = target.__dict__[name] except (AttributeError, KeyError): original = getattr(target, name, DEFAULT) else: local = True if name in _builtins and isinstance(target, ModuleType): self.create = True if not self.create and original is DEFAULT: > raise AttributeError( "%s does not have the attribute %r" % (target, name) ) E AttributeError: does not have the attribute 'DATETIME_HAS_ISODATE' local = False name = 'DATETIME_HAS_ISODATE' original = sentinel.DEFAULT self = target = /usr/lib64/python3.8/unittest/mock.py:1366: AttributeError ===================================================================================== warnings summary ====================================================================================== tests/integration/contrib/django/test_django_project.py::TestPetListView::test_get_no_required_param /usr/lib/python3.8/site-packages/django/conf/__init__.py:229: RemovedInDjango50Warning: The USE_L10N setting is deprecated. Starting with Django 5.0, localized formatting of data will always be enabled. For example Django will display numbers and dates using the format of the current locale. warnings.warn(USE_L10N_DEPRECATED_MSG, RemovedInDjango50Warning) tests/integration/contrib/django/test_django_project.py: 96 warnings tests/integration/contrib/falcon/test_falcon_project.py: 78 warnings tests/integration/contrib/flask/test_flask_decorator.py: 2 warnings tests/integration/contrib/flask/test_flask_validator.py: 5 warnings tests/integration/contrib/flask/test_flask_views.py: 3 warnings tests/integration/contrib/requests/test_requests_validation.py: 10 warnings tests/integration/contrib/starlette/test_starlette_validation.py: 5 warnings tests/integration/contrib/werkzeug/test_werkzeug_validation.py: 10 warnings tests/integration/validation/test_petstore.py: 146 warnings tests/integration/validation/test_read_only_write_only.py: 5 warnings tests/integration/validation/test_security_override.py: 3 warnings tests/integration/validation/test_validators.py: 51 warnings tests/unit/unmarshalling/test_unmarshal.py: 4 warnings tests/unit/unmarshalling/test_validate.py: 197 warnings /usr/lib/python3.8/site-packages/openapi_schema_validator/validators.py:120: DeprecationWarning: write property is deprecated. Use OAS30WriteValidator instead. warnings.warn( tests/integration/contrib/django/test_django_project.py: 61 warnings tests/integration/contrib/falcon/test_falcon_project.py: 61 warnings tests/integration/contrib/flask/test_flask_decorator.py: 5 warnings tests/integration/contrib/flask/test_flask_views.py: 8 warnings tests/integration/contrib/requests/test_requests_validation.py: 4 warnings tests/integration/contrib/starlette/test_starlette_validation.py: 4 warnings tests/integration/contrib/werkzeug/test_werkzeug_validation.py: 4 warnings tests/integration/validation/test_petstore.py: 161 warnings tests/integration/validation/test_read_only_write_only.py: 5 warnings tests/integration/validation/test_validators.py: 20 warnings tests/unit/unmarshalling/test_unmarshal.py: 25 warnings /usr/lib/python3.8/site-packages/openapi_schema_validator/validators.py:113: DeprecationWarning: read property is deprecated. Use OAS30ReadValidator instead. warnings.warn( tests/integration/contrib/requests/test_requests_validation.py::TestRequestsOpenAPIValidation::test_response_validator_path_pattern /usr/lib/python3.8/site-packages/responses/__init__.py:421: DeprecationWarning: Argument 'match_querystring' is deprecated. Use 'responses.matchers.query_param_matcher' or 'responses.matchers.query_string_matcher' warn( tests/unit/unmarshalling/test_unmarshal.py::TestOAS30SchemaUnmarshallerUnmarshal::test_schema_custom_format_invalid tests/unit/unmarshalling/test_unmarshal.py::TestOAS30SchemaUnmarshallerCall::test_string_format_custom tests/unit/unmarshalling/test_unmarshal.py::TestOAS30SchemaUnmarshallerCall::test_string_format_custom_value_error /home/tkloczko/rpmbuild/BUILDROOT/python-openapi-core-0.16.5-3.fc35.x86_64/usr/lib/python3.8/site-packages/openapi_core/unmarshalling/schemas/formatters.py:28: DeprecationWarning: Unmarshal method is deprecated. Rename unmarshal method to format instead. warnings.warn( -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html -------------------------------------------------- generated xml file: /home/tkloczko/rpmbuild/BUILD/openapi-core-0.16.5/reports/junit.xml -------------------------------------------------- ================================================================================== short test summary info ================================================================================== XFAIL tests/unit/templating/test_paths_finders.py::TestOperationSimpleServerServerNotFound::test_raises - returns default server XFAIL tests/unit/templating/test_paths_finders.py::TestPathSimpleServerServerNotFound::test_raises - returns default server XFAIL tests/unit/templating/test_paths_finders.py::TestOperationVariableServerServerNotFound::test_raises - returns default server XFAIL tests/unit/templating/test_paths_finders.py::TestPathVariableServerServerNotFound::test_raises - returns default server XFAIL tests/unit/unmarshalling/test_unmarshal.py::TestOAS30SchemaUnmarshallerCall::test_null_not_supported XPASS tests/unit/templating/test_paths_finders.py::TestSpecSimpleServerServerNotFound::test_raises returns default server XPASS tests/unit/templating/test_paths_finders.py::TestSpecVariableServerServerNotFound::test_raises returns default server FAILED tests/unit/unmarshalling/test_validate.py::TestSchemaValidate::test_string_format_date_invalid[true] - Failed: DID NOT RAISE FAILED tests/unit/unmarshalling/test_validate.py::TestSchemaValidate::test_string_format_uuid_invalid[true0] - Failed: DID NOT RAISE FAILED tests/unit/unmarshalling/test_validate.py::TestSchemaValidate::test_string_format_datetime_invalid[true0] - Failed: DID NOT RAISE FAILED tests/unit/unmarshalling/test_validate.py::TestSchemaValidate::test_string_format_datetime_strict_rfc3339[1989-01-02T00:00:00Z] - AttributeError: does not have the attribute 'DATETIME_HAS_ISODATE' FAILED tests/unit/unmarshalling/test_validate.py::TestSchemaValidate::test_string_format_datetime_strict_rfc3339[2018-01-02T23:59:59Z] - AttributeError: does not have the attribute 'DATETIME_HAS_ISODATE' FAILED tests/unit/unmarshalling/test_validate.py::TestSchemaValidate::test_string_format_datetime_isodate[1989-01-02T00:00:00Z] - AttributeError: does not have the attribute 'DATETIME_HAS_ISODATE' FAILED tests/unit/unmarshalling/test_validate.py::TestSchemaValidate::test_string_format_datetime_isodate[2018-01-02T23:59:59Z] - AttributeError: does not have the attribute 'DATETIME_HAS_ISODATE' ============================================================= 7 failed, 728 passed, 5 xfailed, 2 xpassed, 978 warnings in 5.12s ============================================================= ```

Here is list of installed modules in build env

```console Package Version ----------------------------- ----------------- alabaster 0.7.13 anyio 3.6.2 asgiref 3.4.1 attrs 22.2.0 Babel 2.12.1 backports.zoneinfo 0.2.1 build 0.9.0 charset-normalizer 3.0.1 click 8.1.3 distro 1.8.0 Django 4.0.4 djangorestframework 3.14.0 docutils 0.19 exceptiongroup 1.0.0 falcon 3.1.1 flake8 5.0.4 Flask 2.2.2 gpg 1.18.0-unknown idna 3.4 imagesize 1.4.1 importlib-metadata 6.0.0 importlib-resources 5.12.0 iniconfig 2.0.0 isodate 0.6.1 itsdangerous 2.1.2 Jinja2 3.1.2 jsonschema 4.17.3 jsonschema-spec 0.1.3 lazy-object-proxy 1.9.0 libcomps 0.1.19 MarkupSafe 2.1.2 mccabe 0.7.0 more-itertools 9.1.0 openapi-schema-validator 0.4.3 openapi-spec-validator 0.5.5 packaging 23.0 parse 1.19.0 pathable 0.4.3 pep517 0.13.0 pip 22.3.1 pkgutil_resolve_name 1.3.10 pluggy 1.0.0 poetry-core 1.5.1 pycodestyle 2.9.1 pyflakes 2.5.0 Pygments 2.14.0 pyrsistent 0.19.3 pytest 7.2.1 pytest-flake8 1.1.1 python-dateutil 2.8.2 pytz 2022.4 PyYAML 6.0 requests 2.28.2 responses 0.22.0 rfc3339-validator 0.1.4 rpm 4.17.0 six 1.16.0 sniffio 1.2.0 snowballstemmer 2.2.0 Sphinx 6.1.3 sphinxcontrib-applehelp 1.0.4 sphinxcontrib-devhelp 1.0.2.dev20230202 sphinxcontrib-htmlhelp 2.0.0 sphinxcontrib-jsmath 1.0.1.dev20230128 sphinxcontrib-qthelp 1.0.3.dev20230128 sphinxcontrib-serializinghtml 1.1.5 sqlparse 0.4.2 starlette 0.20.4 strict-rfc3339 0.7 tomli 2.0.1 tomli_w 1.0.0 typing_extensions 4.4.0 urllib3 1.26.12 WebOb 1.8.7 Werkzeug 2.2.2 wheel 0.38.4 zipp 3.15.0 ```
p1c2u commented 1 year ago

@kloczek thank you for this report. I think this is because of backward incompatibility introduced here https://github.com/python-openapi/openapi-schema-validator/releases/tag/0.4.2 Worth to release a fix for 0.16.x branch that limits the dependency to version 0.4.1 at most or make the tests compatible with openapi-schema-validator 0.4.2.

p1c2u commented 1 year ago

Version 0.16.6 released with the fix hence closing.

kloczek commented 1 year ago

Just tested 0.16.6 and test site passes without errors/fauls. I see some warnings which probably one is related to openapi-core code Here is pytest output:

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-openapi-core-0.16.6-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-openapi-core-0.16.6-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' ============================= test session starts ============================== platform linux -- Python 3.8.16, pytest-7.2.1, pluggy-1.0.0 rootdir: /home/tkloczko/rpmbuild/BUILD/openapi-core-0.16.6, configfile: pyproject.toml plugins: anyio-3.6.2, flake8-1.1.1 collected 735 items tests/integration/contrib/django/test_django_project.py Bad Request: /v1/pets ..Bad Request: /v1/pets .Bad Request: /v1/pets .Unsupported Media Type: /v1/pets .Bad Request: /v1/pets ...Invalid HTTP_HOST header: 'testserver'. You may need to add 'testserver' to ALLOWED_HOSTS. Bad Request: /v1/pets/12 .Forbidden: /v1/pets/12 .Method Not Allowed: /v1/pets/12 ... tests/integration/contrib/falcon/test_falcon_project.py ............. tests/integration/contrib/flask/test_flask_decorator.py ...... tests/integration/contrib/flask/test_flask_validator.py . tests/integration/contrib/flask/test_flask_views.py ....... tests/integration/contrib/requests/test_requests_validation.py ... tests/integration/contrib/starlette/test_starlette_validation.py .. tests/integration/contrib/werkzeug/test_werkzeug_validation.py ... tests/integration/schema/test_empty.py . tests/integration/schema/test_link_spec.py .... tests/integration/schema/test_path_params.py .. tests/integration/schema/test_spec.py .. tests/integration/validation/test_minimal.py ............................................................ tests/integration/validation/test_petstore.py ..................................... tests/integration/validation/test_read_only_write_only.py .... tests/integration/validation/test_security_override.py ..... tests/integration/validation/test_validators.py ............................ tests/unit/test_util.py ................. tests/unit/casting/test_schema_casters.py .... tests/unit/contrib/django/test_django.py ...... tests/unit/contrib/flask/test_flask_requests.py ... tests/unit/contrib/flask/test_flask_responses.py . tests/unit/contrib/requests/test_requests_requests.py ... tests/unit/contrib/requests/test_requests_responses.py . tests/unit/deserializing/test_media_types_deserializers.py ......... tests/unit/deserializing/test_parameters_deserializers.py ... tests/unit/extensions/test_factories.py .. tests/unit/schema/test_schema_parameters.py ..................................................................................................................................................... tests/unit/security/test_providers.py ......... tests/unit/templating/test_media_types_finders.py .... tests/unit/templating/test_paths_finders.py X..x..x...........X..x..x........... tests/unit/templating/test_responses_finders.py ... tests/unit/templating/test_templating_util.py .. tests/unit/unmarshalling/test_unmarshal.py ....................................................................x......................... tests/unit/unmarshalling/test_validate.py .................................................................................................................................................................................................. tests/unit/validation/test_request_shortcuts.py .. tests/unit/validation/test_response_shortcuts.py .. =============================== warnings summary =============================== tests/integration/contrib/django/test_django_project.py::TestPetListView::test_get_no_required_param /usr/lib/python3.8/site-packages/django/conf/__init__.py:229: RemovedInDjango50Warning: The USE_L10N setting is deprecated. Starting with Django 5.0, localized formatting of data will always be enabled. For example Django will display numbers and dates using the format of the current locale. warnings.warn(USE_L10N_DEPRECATED_MSG, RemovedInDjango50Warning) tests/integration/contrib/django/test_django_project.py: 96 warnings tests/integration/contrib/falcon/test_falcon_project.py: 78 warnings tests/integration/contrib/flask/test_flask_decorator.py: 2 warnings tests/integration/contrib/flask/test_flask_validator.py: 5 warnings tests/integration/contrib/flask/test_flask_views.py: 3 warnings tests/integration/contrib/requests/test_requests_validation.py: 10 warnings tests/integration/contrib/starlette/test_starlette_validation.py: 5 warnings tests/integration/contrib/werkzeug/test_werkzeug_validation.py: 10 warnings tests/integration/validation/test_petstore.py: 146 warnings tests/integration/validation/test_read_only_write_only.py: 5 warnings tests/integration/validation/test_security_override.py: 3 warnings tests/integration/validation/test_validators.py: 51 warnings tests/unit/unmarshalling/test_unmarshal.py: 4 warnings tests/unit/unmarshalling/test_validate.py: 194 warnings /usr/lib/python3.8/site-packages/openapi_schema_validator/validators.py:120: DeprecationWarning: write property is deprecated. Use OAS30WriteValidator instead. warnings.warn( tests/integration/contrib/django/test_django_project.py: 61 warnings tests/integration/contrib/falcon/test_falcon_project.py: 61 warnings tests/integration/contrib/flask/test_flask_decorator.py: 5 warnings tests/integration/contrib/flask/test_flask_views.py: 8 warnings tests/integration/contrib/requests/test_requests_validation.py: 4 warnings tests/integration/contrib/starlette/test_starlette_validation.py: 4 warnings tests/integration/contrib/werkzeug/test_werkzeug_validation.py: 4 warnings tests/integration/validation/test_petstore.py: 161 warnings tests/integration/validation/test_read_only_write_only.py: 5 warnings tests/integration/validation/test_validators.py: 20 warnings tests/unit/unmarshalling/test_unmarshal.py: 25 warnings /usr/lib/python3.8/site-packages/openapi_schema_validator/validators.py:113: DeprecationWarning: read property is deprecated. Use OAS30ReadValidator instead. warnings.warn( tests/integration/contrib/requests/test_requests_validation.py::TestRequestsOpenAPIValidation::test_response_validator_path_pattern /usr/lib/python3.8/site-packages/responses/__init__.py:421: DeprecationWarning: Argument 'match_querystring' is deprecated. Use 'responses.matchers.query_param_matcher' or 'responses.matchers.query_string_matcher' warn( tests/unit/unmarshalling/test_unmarshal.py::TestOAS30SchemaUnmarshallerUnmarshal::test_schema_custom_format_invalid tests/unit/unmarshalling/test_unmarshal.py::TestOAS30SchemaUnmarshallerCall::test_string_format_custom tests/unit/unmarshalling/test_unmarshal.py::TestOAS30SchemaUnmarshallerCall::test_string_format_custom_value_error /home/tkloczko/rpmbuild/BUILDROOT/python-openapi-core-0.16.6-2.fc35.x86_64/usr/lib/python3.8/site-packages/openapi_core/unmarshalling/schemas/formatters.py:28: DeprecationWarning: Unmarshal method is deprecated. Rename unmarshal method to format instead. warnings.warn( -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html - generated xml file: /home/tkloczko/rpmbuild/BUILD/openapi-core-0.16.6/reports/junit.xml - =========================== short test summary info ============================ XFAIL tests/unit/templating/test_paths_finders.py::TestOperationSimpleServerServerNotFound::test_raises - returns default server XFAIL tests/unit/templating/test_paths_finders.py::TestPathSimpleServerServerNotFound::test_raises - returns default server XFAIL tests/unit/templating/test_paths_finders.py::TestOperationVariableServerServerNotFound::test_raises - returns default server XFAIL tests/unit/templating/test_paths_finders.py::TestPathVariableServerServerNotFound::test_raises - returns default server XFAIL tests/unit/unmarshalling/test_unmarshal.py::TestOAS30SchemaUnmarshallerCall::test_null_not_supported XPASS tests/unit/templating/test_paths_finders.py::TestSpecSimpleServerServerNotFound::test_raises returns default server XPASS tests/unit/templating/test_paths_finders.py::TestSpecVariableServerServerNotFound::test_raises returns default server =========== 728 passed, 5 xfailed, 2 xpassed, 975 warnings in 4.16s ============ ```