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

Filter warnings from Django during capture. #262

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/test_jsonfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ def test_load_invalid_json(self):

with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
warnings.filterwarnings("ignore", module="django.utils.asyncio")
instance = JSONNotRequiredModel.objects.get()

self.assertEqual(len(w), 1)
Expand All @@ -329,6 +330,7 @@ def test_resave_invalid_json(self):

with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
warnings.filterwarnings("ignore", module="django.utils.asyncio")
instance = JSONNotRequiredModel.objects.get()

self.assertEqual(len(w), 1)
Expand All @@ -339,6 +341,7 @@ def test_resave_invalid_json(self):

with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
warnings.filterwarnings("ignore", module="django.utils.asyncio")
instance = JSONNotRequiredModel.objects.get()

# No deserialization issues, as 'foo' was saved as a serialized string.
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ deps =
isort

[testenv:lint]
commands = flake8 jsonfield tests {posargs}
commands = flake8 src tests {posargs}
deps =
flake8

Expand Down