summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2019-08-22 19:24:25 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-08-22 19:24:25 (GMT)
commit4be11c009abe88175fa164b45e4838e7267dfa97 (patch)
tree19f0c688af902ba0403f3c5c0d5e51b4949e66d7 /Lib
parent8889627b53e1eea2e32590f1867fbb0b0fc7407f (diff)
downloadcpython-4be11c009abe88175fa164b45e4838e7267dfa97.zip
cpython-4be11c009abe88175fa164b45e4838e7267dfa97.tar.gz
cpython-4be11c009abe88175fa164b45e4838e7267dfa97.tar.bz2
bpo-37915: Fix comparison between tzinfo objects and timezone objects (GH-15390)
https://bugs.python.org/issue37915 Automerge-Triggered-By: @pablogsal
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/datetimetester.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index d0101c9..5800487 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -413,6 +413,11 @@ class TestTimeZone(unittest.TestCase):
with self.assertRaises(ValueError):
timezone(delta)
+ def test_comparison_with_tzinfo(self):
+ # Constructing tzinfo objects directly should not be done by users
+ # and serves only to check the bug described in bpo-37915
+ self.assertNotEqual(timezone.utc, tzinfo())
+ self.assertNotEqual(timezone(timedelta(hours=1)), tzinfo())
#############################################################################
# Base class for testing a particular aspect of timedelta, time, date and