mirror of
https://github.com/python/cpython.git
synced 2025-08-27 20:25:18 +00:00
bpo-37915: Fix comparison between tzinfo objects and timezone objects (GH-15390)
https://bugs.python.org/issue37915 Automerge-Triggered-By: @pablogsal
This commit is contained in:
parent
8889627b53
commit
4be11c009a
3 changed files with 10 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue