[Python-checkins] cpython (3.2): Issue #11886: workaround an OS bug (time zone data) in test_time

victor.stinner python-checkins at python.org
Thu Dec 8 00:32:58 CET 2011


http://hg.python.org/cpython/rev/c143e66e5efe
changeset:   73886:c143e66e5efe
branch:      3.2
parent:      73882:17ceebc61b65
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Thu Dec 08 00:32:51 2011 +0100
summary:
  Issue #11886: workaround an OS bug (time zone data) in test_time

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

files:
  Lib/test/test_time.py |  7 ++++++-
  1 files changed, 6 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -206,7 +206,12 @@
             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)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list