Skip to content

Commit

Permalink
Merge pull request #1192 from kulikjak/pytest-warnings-fix
Browse files Browse the repository at this point in the history
Pytest warnings fix
  • Loading branch information
pganssle committed Feb 12, 2022
2 parents 83ec82c + 5063b48 commit 1eea4fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
14 changes: 7 additions & 7 deletions tests/test_internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import sys
import pytest
import warnings

from dateutil.parser._parser import _ymd
from dateutil import tz
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1eea4fc

Please sign in to comment.