summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Ganssle <1377457+pganssle@users.noreply.github.com>2022-02-12 08:16:00 -0500
committerGitHub <noreply@github.com>2022-02-12 08:16:00 -0500
commit1eea4fc60aa85858a11e1241e7a7fe9be5603c21 (patch)
tree159af8d38a230c6a8d1638fda1a6c0d6127783e2
parent83ec82cb5e032ab31e5aae49902cf61be38ddfc2 (diff)
parent5063b48d9b3de81b037769f5c819d5a6db723a4d (diff)
downloaddateutil-git-1eea4fc60aa85858a11e1241e7a7fe9be5603c21.tar.gz
Merge pull request #1192 from kulikjak/pytest-warnings-fix
Pytest warnings fix
-rw-r--r--AUTHORS.md1
-rw-r--r--tests/test_internals.py14
2 files changed, 8 insertions, 7 deletions
diff --git a/AUTHORS.md b/AUTHORS.md
index 84b92a3..c96570d 100644
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -60,6 +60,7 @@ switch, and thus all their contributions are dual-licensed.
- Ionuț Ciocîrlan <jdxlark@MASKED>
- Jacqueline Chen <jacqueline415@outlook.com> (gh: @jachen20) **D**
- Jake Chorley (gh: @jakec-github) **D**
+- Jakub Kulík (gh: @kulikjak) **D**
- Jan Studený <jendas1@MASKED>
- Jay Weisskopf <jay@jayschwa.net> (gh: @jayschwa) **D**
- Jitesh <jitesh@MASKED>
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