]> granicus.if.org Git - python/commitdiff
Issue #11886: workaround an OS bug (time zone data) in test_time
authorVictor Stinner <victor.stinner@haypocalc.com>
Wed, 7 Dec 2011 23:32:51 +0000 (00:32 +0100)
committerVictor Stinner <victor.stinner@haypocalc.com>
Wed, 7 Dec 2011 23:32:51 +0000 (00:32 +0100)
Australian Eastern Standard Time (UTC+10) is called "EST" (as Eastern Standard
Time, UTC-5) instead of "AEST" on some operating systems (e.g. FreeBSD), which
is wrong. See for example this bug:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=93810

Lib/test/test_time.py

index 0f00b1af52d24689153bc803f94fbe757f78b42f..28917ca85684a31bc2879f3a771c49651b0d1f96 100644 (file)
@@ -184,7 +184,12 @@ class TimeTestCase(unittest.TestCase):
             environ['TZ'] = victoria
             time.tzset()
             self.assertNotEqual(time.gmtime(xmas2002), time.localtime(xmas2002))
-            self.assertTrue(time.tzname[0] == 'AEST', str(time.tzname[0]))
+
+            # Issue #11886: Australian Eastern Standard Time (UTC+10) is called
+            # "EST" (as Eastern Standard Time, UTC-5) instead of "AEST" on some
+            # operating systems (e.g. FreeBSD), which is wrong. See for example
+            # this bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=93810
+            self.assertIn(time.tzname[0], ('AEST' 'EST'), time.tzname[0])
             self.assertTrue(time.tzname[1] == 'AEDT', str(time.tzname[1]))
             self.assertEqual(len(time.tzname), 2)
             self.assertEqual(time.daylight, 1)