Skip to content

Commit

Permalink
add assertions for res.tzinfo is expected.tzinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel committed Mar 4, 2019
1 parent 4b0a394 commit 9aff4bd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dateutil/test/test_parser.py
Expand Up @@ -277,6 +277,7 @@ def test_valid_tzinfo_tzinfo_input(self):
expected = datetime(2014, 1, 19, 9, tzinfo=tz.UTC)
res = parse(dstr, tzinfos=tzinfos)
assert res == expected
assert res.tzinfo is expected.tzinfo

def test_valid_tzinfo_unicode_input(self):
dstr = "2014 January 19 09:00 UTC"
Expand All @@ -294,6 +295,7 @@ def tzinfos(*args, **kwargs):
expected = datetime(2014, 1, 19, 9, tzinfo=tz.tzstr("UTC+0"))
res = parse(dstr, tzinfos=tzinfos)
assert res == expected
assert res.tzinfo is expected.tzinfo

@pytest.mark.xfail(reason="Doesn't check for UTC in tzinfos dict, "
"not sure it *should*.")
Expand All @@ -303,6 +305,7 @@ def test_valid_tzinfo_int_input(self):
expected = datetime(2014, 1, 19, 9, tzinfo=tz.UTC)
res = parse(dstr, tzinfos=tzinfos)
assert res == expected
assert res.tzinfo is expected.tzinfo


class ParserTest(unittest.TestCase):
Expand Down

0 comments on commit 9aff4bd

Please sign in to comment.