]> granicus.if.org Git - python/commitdiff
Issue #19265: Improve test coverage of datetime.tzinfo
authorBerker Peksag <berker.peksag@gmail.com>
Sat, 19 Mar 2016 11:16:32 +0000 (13:16 +0200)
committerBerker Peksag <berker.peksag@gmail.com>
Sat, 19 Mar 2016 11:16:32 +0000 (13:16 +0200)
Without the patch, line 1010 of Lib/datetime.py wasn't covered
by the test suite.

Patch by Colin Williams.

Lib/test/datetimetester.py

index 63bfed53965f73047e3748184f3ca9ecc01cf7b4..7743c67c8c33a2253d0a6f04d4bf947f858b0562 100644 (file)
@@ -117,6 +117,9 @@ class PicklableFixedOffset(FixedOffset):
     def __init__(self, offset=None, name=None, dstoffset=None):
         FixedOffset.__init__(self, offset, name, dstoffset)
 
+    def __getstate__(self):
+        return self.__dict__
+
 class _TZInfo(tzinfo):
     def utcoffset(self, datetime_module):
         return random.random()