From 9aff4bd6f4de1453f981bf24c3a7bdab00b43b4c Mon Sep 17 00:00:00 2001 From: Brock Mendel Date: Mon, 4 Mar 2019 09:31:59 -0800 Subject: [PATCH] add assertions for res.tzinfo is expected.tzinfo --- dateutil/test/test_parser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dateutil/test/test_parser.py b/dateutil/test/test_parser.py index b5cb39acc..a71a1b026 100644 --- a/dateutil/test/test_parser.py +++ b/dateutil/test/test_parser.py @@ -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" @@ -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*.") @@ -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):