diff options
author | Jakub Kulík <kulikjak@gmail.com> | 2022-02-10 10:28:42 +0100 |
---|---|---|
committer | Jakub Kulík <kulikjak@gmail.com> | 2022-02-10 10:28:42 +0100 |
commit | 2bdd63158b7f981fc6d70a869680451bdfd8d848 (patch) | |
tree | 497a72765c6db1967ce15b7f6a98630583b12cd1 | |
parent | 83ec82cb5e032ab31e5aae49902cf61be38ddfc2 (diff) | |
download | dateutil-git-2bdd63158b7f981fc6d70a869680451bdfd8d848.tar.gz |
Remove deprecated pytest.warns(None) from test_internals.py
-rw-r--r-- | tests/test_internals.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/test_internals.py b/tests/test_internals.py index 5308131..b32e672 100644 --- a/tests/test_internals.py +++ b/tests/test_internals.py @@ -9,6 +9,7 @@ code that may be difficult to reach through the standard API calls. import sys import pytest +import warnings from dateutil.parser._parser import _ymd from dateutil import tz @@ -65,18 +66,17 @@ def test_parser_parser_private_not_warns(): from dateutil.parser._parser import _timelex, _tzparser from dateutil.parser._parser import _parsetz - with pytest.warns(None) as recorder: + with warnings.catch_warnings(): + warnings.simplefilter("error") _tzparser() - assert len(recorder) == 0 - with pytest.warns(None) as recorder: + with warnings.catch_warnings(): + warnings.simplefilter("error") _timelex('2014-03-03') - assert len(recorder) == 0 - - with pytest.warns(None) as recorder: + with warnings.catch_warnings(): + warnings.simplefilter("error") _parsetz('+05:00') - assert len(recorder) == 0 @pytest.mark.tzstr |