This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Increased test coverage for datetime pickling
Type: enhancement Stage: resolved
Components: Library (Lib), Tests Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Colin.Williams, belopolsky, berker.peksag, ezio.melotti, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2013-10-15 11:24 by Colin.Williams, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
datetimepickling.patch Colin.Williams, 2013-10-15 11:24 review
Messages (5)
msg199993 - (view) Author: Colin Williams (Colin.Williams) Date: 2013-10-15 11:24
This just increases test coverage for the datetime module by one line.
msg200375 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2013-10-19 05:49
I guess the extra coverage is in "if getstate" branch of

class tzinfo:
    ...
    def __reduce__(self):
        getinitargs = getattr(self, "__getinitargs__", None)
        if getinitargs:
            args = getinitargs()
        else:
            args = ()
        getstate = getattr(self, "__getstate__", None)
        if getstate:
            state = getstate()
        else:
            state = getattr(self, "__dict__", None) or None
        if state is None:
            return (self.__class__, args)
        else:
            return (self.__class__, args, state)

The other branch is probably covered by timezone class tests.  The patch looks good to me.
msg262038 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-03-19 11:15
New changeset c6649d4477ab by Berker Peksag in branch '3.5':
Issue #19265: Improve test coverage of datetime.tzinfo
https://hg.python.org/cpython/rev/c6649d4477ab

New changeset f1539e7607e4 by Berker Peksag in branch 'default':
Issue #19265: Improve test coverage of datetime.tzinfo
https://hg.python.org/cpython/rev/f1539e7607e4
msg262039 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-03-19 11:16
Thanks for the patch, Colin!
msg262042 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-03-19 12:03
These lines should be removed again after applying the patch for issue26579.
History
Date User Action Args
2022-04-11 14:57:52adminsetgithub: 63464
2016-03-19 12:03:12serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg262042
2016-03-19 11:16:23berker.peksagsetstatus: open -> closed

versions: + Python 3.5, Python 3.6, - Python 3.4
nosy: + berker.peksag

messages: + msg262039
resolution: fixed
stage: patch review -> resolved
2016-03-19 11:15:40python-devsetnosy: + python-dev
messages: + msg262038
2013-10-19 05:49:17belopolskysetmessages: + msg200375
2013-10-19 05:17:03ezio.melottisetnosy: + ezio.melotti
2013-10-15 14:03:22pitrousetnosy: + belopolsky
stage: patch review

components: + Tests
versions: + Python 3.4, - Python 3.5
2013-10-15 11:24:40Colin.Williamscreate