summaryrefslogtreecommitdiff
path: root/Lib/test/datetimetester.py
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2016-03-25 15:42:59 -0400
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2016-03-25 15:42:59 -0400
commit4a570a7b8a14db38813500e24ed316e22221ed81 (patch)
treeda2b60b574b794374fb8ca9a9e990b224102e2eb /Lib/test/datetimetester.py
parentf3efba6269c21707a5c893f5ef70519f2ce868da (diff)
downloadcpython-4a570a7b8a14db38813500e24ed316e22221ed81.tar.gz
Issue#26616:Fixed a bug in datetime.astimezone() method.
Diffstat (limited to 'Lib/test/datetimetester.py')
-rw-r--r--Lib/test/datetimetester.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index 7743c67c8c..b9071640c4 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -3426,6 +3426,14 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
self.assertEqual(dt, local)
self.assertEqual(local.strftime("%z %Z"), "-0400 EDT")
+ @support.run_with_tz('EST+05EDT,M3.2.0,M11.1.0')
+ def test_astimezone_default_near_fold(self):
+ # Issue #26616.
+ u = datetime(2015, 11, 1, 5, tzinfo=timezone.utc)
+ t = u.astimezone()
+ s = t.astimezone()
+ self.assertEqual(t.tzinfo, s.tzinfo)
+
def test_aware_subtract(self):
cls = self.theclass