From 192d14a4e5238731a5105f479dc4a511e45aa7ec 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 434db57b3..0278c942c 100644 --- a/dateutil/test/test_parser.py +++ b/dateutil/test/test_parser.py @@ -373,6 +373,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" @@ -390,6 +391,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*.") @@ -399,6 +401,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):