Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented Feb 15, 2024

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

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 python-openapi#789
Copy link

codecov bot commented Feb 15, 2024

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 ⚠️
...penapi_core/unmarshalling/schemas/unmarshallers.py 90.00% 2 Missing ⚠️
openapi_core/contrib/fastapi/requests.py 80.00% 1 Missing ⚠️
openapi_core/contrib/fastapi/responses.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@p1c2u
Copy link
Collaborator

p1c2u commented Feb 15, 2024

Thanks for the fix

@p1c2u p1c2u merged commit 9cf4dc2 into python-openapi:master Feb 15, 2024
@mgorny
Copy link
Contributor Author

mgorny commented Feb 15, 2024

Thanks!

@mgorny mgorny deleted the pytest-8 branch February 15, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Please add support for pytest-8
2 participants