summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2011-11-01 15:58:54 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2011-11-01 15:58:54 (GMT)
commit050c7e64cddb6669b0d335f3667609a7651052d3 (patch)
tree629c33ff7c02b3c8ed279d656f3fa0c05b4eaaac /Lib
parent4c875a986fbbd51774dbc87b742e6e71b57eef58 (diff)
downloadcpython-050c7e64cddb6669b0d335f3667609a7651052d3.zip
cpython-050c7e64cddb6669b0d335f3667609a7651052d3.tar.gz
cpython-050c7e64cddb6669b0d335f3667609a7651052d3.tar.bz2
Replace temporary tests with the real test case for issue #13309 on Gentoo.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_time.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index 106d8aa..4d8b8f5 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -161,10 +161,6 @@ class TimeTestCase(unittest.TestCase):
self.fail("conversion specifier %r failed with '%s' input." %
(format, strf_output))
- # XXX Temporary tests to troubleshoot issue #13309 on buildbots
- test_maa_strptime = test_strptime
- test_mzz_strptime = test_strptime
-
def test_strptime_bytes(self):
# Make sure only strings are accepted as arguments to strptime.
self.assertRaises(TypeError, time.strptime, b'2009', "%Y")
@@ -301,7 +297,8 @@ class TimeTestCase(unittest.TestCase):
t1 = time.mktime(lt1)
self.assertAlmostEqual(t1, t0, delta=0.2)
- def test_mktime(self):
+ # XXX run last to work around issue #13309 on Gentoo
+ def test_ZZZ_mktime(self):
# Issue #1726687
for t in (-2, -1, 0, 1):
try:
@@ -310,8 +307,9 @@ class TimeTestCase(unittest.TestCase):
pass
else:
self.assertEqual(time.mktime(tt), t)
- self.assertNotEqual(time.strftime('%Z', time.gmtime(self.t)), 'LMT',
- "strftime bug after processing t = %s" % t)
+ tt = time.gmtime(self.t)
+ tzname = time.strftime('%Z', tt)
+ self.assertNotEqual(tzname, 'LMT')
# It may not be possible to reliably make mktime return error
# on all platfom. This will make sure that no other exception
# than OverflowError is raised for an extreme value.
@@ -319,6 +317,10 @@ class TimeTestCase(unittest.TestCase):
time.mktime((-1, 1, 1, 0, 0, 0, -1, -1, -1))
except OverflowError:
pass
+ msg = "Issue #13309: the '%Z' specifier reports wrong timezone"
+ self.assertEqual(time.strftime('%Z', tt), tzname, msg)
+ tt = time.gmtime(self.t)
+ self.assertEqual(time.strftime('%Z', tt), tzname, msg)
class TestLocale(unittest.TestCase):