diff options
author | Brett Cannon <bcannon@gmail.com> | 2004-07-12 19:34:02 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2004-07-12 19:34:02 (GMT) |
commit | fdf7449ad232bcb5dc1413a52603ad6e904d9246 (patch) | |
tree | 56e7af2765a81867db54f8e041f29990a71ad7a2 /Lib/test/test_strptime.py | |
parent | 20f42c433b81f64a1e8ac51c895d5292c7881cd8 (diff) | |
download | cpython-fdf7449ad232bcb5dc1413a52603ad6e904d9246.zip cpython-fdf7449ad232bcb5dc1413a52603ad6e904d9246.tar.gz cpython-fdf7449ad232bcb5dc1413a52603ad6e904d9246.tar.bz2 |
Fix test case for when time.tzname[0] is either UTC or GMT. Also have test
output more telling details when there is a failure.
Diffstat (limited to 'Lib/test/test_strptime.py')
-rw-r--r-- | Lib/test/test_strptime.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/test_strptime.py b/Lib/test/test_strptime.py index 70745eb..4333b1b 100644 --- a/Lib/test/test_strptime.py +++ b/Lib/test/test_strptime.py @@ -279,14 +279,19 @@ class StrptimeTests(unittest.TestCase): # when time.tzname[0] == time.tzname[1] and time.daylight if sys.platform == "mac": return #MacOS9 has severely broken timezone support. - tz_name= time.tzname[0] + tz_name = time.tzname[0] + if tz_name.lower() in ("UTC", "GMT"): + return try: original_tzname = time.tzname original_daylight = time.daylight time.tzname = (tz_name, tz_name) time.daylight = 1 tz_value = _strptime.strptime(tz_name, "%Z")[8] - self.failUnlessEqual(tz_value, -1) + self.failUnlessEqual(tz_value, -1, + "%s lead to a timezone value of %s instead of -1 when " + "time.daylight set to %s and passing in %s" % + (time.tzname, tz_value, time.daylight, tz_name)) finally: time.tzname = original_tzname time.daylight = original_daylight |