summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-01-01 04:18:51 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-01-01 04:18:51 (GMT)
commit36087edc05b6ccb4a4850ac579ad721d1a72ffdd (patch)
tree0accd5c46eb94e620f849c267a407b412860beb1 /Lib/test
parent88ad134e3612b32026a9cfb188c55b6ba1664094 (diff)
downloadcpython-36087edc05b6ccb4a4850ac579ad721d1a72ffdd.zip
cpython-36087edc05b6ccb4a4850ac579ad721d1a72ffdd.tar.gz
cpython-36087edc05b6ccb4a4850ac579ad721d1a72ffdd.tar.bz2
The failure of the last-second addition to the timezone coversion test is
understood now: it can't work. Added comments explaining why (it's "the usual"-- unrepresentable hours in local time --but in a slightly different guise).
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_datetime.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py
index 3ef0772..4a7aa60 100644
--- a/Lib/test/test_datetime.py
+++ b/Lib/test/test_datetime.py
@@ -2591,7 +2591,6 @@ class TestTimezoneConversions(unittest.TestCase):
dston = datetimetz(2002, 4, 7, 2)
dstoff = datetimetz(2002, 10, 27, 2)
-
# Check a time that's inside DST.
def checkinside(self, dt, tz, utc, dston, dstoff):
self.assertEqual(dt.dst(), HOUR)
@@ -2691,9 +2690,18 @@ class TestTimezoneConversions(unittest.TestCase):
# hours" don't overlap.
self.convert_between_tz_and_utc(Eastern, Pacific)
self.convert_between_tz_and_utc(Pacific, Eastern)
- # XXX These fail!
- #self.convert_between_tz_and_utc(Eastern, Central)
- #self.convert_between_tz_and_utc(Central, Eastern)
+ # OTOH, these fail! Don't enable them. The difficulty is that
+ # the edge case tests assume that every hour is representable in
+ # the "utc" class. This is always true for a fixed-offset tzinfo
+ # class (lke utc_real and utc_fake), but not for Eastern or Central.
+ # For these adjacent DST-aware time zones, the range of time offsets
+ # tested ends up creating hours in the one that aren't representable
+ # in the other. For the same reason, we would see failures in the
+ # Eastern vs Pacific tests too if we added 3*HOUR to the list of
+ # offset deltas in convert_between_tz_and_utc().
+ #
+ # self.convert_between_tz_and_utc(Eastern, Central) # can't work
+ # self.convert_between_tz_and_utc(Central, Eastern) # can't work
def test_suite():