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 132 forks source link

[Feature]: Please add support for pytest-8 #789

Closed mgorny closed 7 months ago

mgorny commented 7 months ago

Suggested Behavior

Please consider adding support for pytest-8.

Why is this needed?

The test suite currently fails with this version:

FAILED tests/unit/test_shortcuts.py::TestUnmarshalResponse::test_request_response_error - Failed: DID NOT WARN. No warnings of type (<class 'DeprecationWarning'>,) were emitted.
FAILED tests/unit/test_shortcuts.py::TestValidateRequest::test_spec_invalid - Failed: DID NOT WARN. No warnings of type (<class 'DeprecationWarning'>,) were emitted.
FAILED tests/unit/test_shortcuts.py::TestValidateRequest::test_spec_not_detected - Failed: DID NOT WARN. No warnings of type (<class 'DeprecationWarning'>,) were emitted.
FAILED tests/unit/test_shortcuts.py::TestValidateRequest::test_webhook_request_validator_not_found - Failed: DID NOT WARN. No warnings of type (<class 'DeprecationWarning'>,) were emitted.
FAILED tests/unit/test_shortcuts.py::TestValidateResponse::test_spec_not_detected - Failed: DID NOT WARN. No warnings of type (<class 'DeprecationWarning'>,) were emitted.
FAILED tests/unit/test_shortcuts.py::TestValidateResponse::test_spec_not_supported - Failed: DID NOT WARN. No warnings of type (<class 'DeprecationWarning'>,) were emitted.
FAILED tests/unit/test_shortcuts.py::TestValidateResponse::test_webhook_response_validator_not_found - Failed: DID NOT WARN. No warnings of type (<class 'DeprecationWarning'>,) were emitted.

Unless I'm mistaken, all the failures result from pytest.warns() being fixed to work inside pytest.raises(), and the warnings not actually being raised (previously, it was ignored).

References

https://docs.pytest.org/en/stable/changelog.html#id38

Would you like to implement a feature?

Yes