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

Remove spurious `pytest.warns()` to fix pytest-8 compatibility #790

Closed mgorny closed 7 months ago

mgorny commented 7 months ago

Remove the spurious pytest.warns() contexts within pytest.raises() in test_shortcuts, in order to fix compatibility with pytest-8.0.0. Prior to this version, the exception raised caused these assertions to be ignored entirely. This is fixed in pytest-8.0.0, and the tests start failing because the warning is never raised prior to the exception.

Fixes #789

codecov[bot] commented 7 months ago

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (c267743) 90.58% compared to head (36da765) 90.37%. Report is 22 commits behind head on master.

Files Patch % Lines
openapi_core/validation/schemas/validators.py 76.47% 2 Missing and 2 partials :warning:
...penapi_core/unmarshalling/schemas/unmarshallers.py 90.00% 2 Missing :warning:
openapi_core/contrib/fastapi/requests.py 80.00% 1 Missing :warning:
openapi_core/contrib/fastapi/responses.py 83.33% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #790 +/- ## ========================================== - Coverage 90.58% 90.37% -0.22% ========================================== Files 139 143 +4 Lines 4207 4228 +21 Branches 514 515 +1 ========================================== + Hits 3811 3821 +10 - Misses 301 311 +10 - Partials 95 96 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

p1c2u commented 7 months ago

Thanks for the fix

mgorny commented 7 months ago

Thanks!