Skip to content
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

fix test with warnings #493

Merged
merged 1 commit into from Feb 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions responses/test_responses.py
Expand Up @@ -3,6 +3,7 @@
import inspect
import os
import re
import warnings
from io import BufferedReader
from io import BytesIO
from unittest.mock import Mock
Expand Down Expand Up @@ -587,12 +588,10 @@ def run():
assert resp.status_code == status
assert "foo" in resp.headers

with pytest.warns(None) as record:
with warnings.catch_warnings():
warnings.simplefilter("error")
run()

# check that no deprecation warning was raised
assert not record

assert_reset()


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -25,7 +25,7 @@
]

tests_require = [
"pytest>=4.6",
"pytest>=7.0.0",
"coverage >= 6.0.0",
"pytest-cov",
"pytest-asyncio",
Expand Down