Author marco.buttu
Recipients Jelle Zijlstra, berker.peksag, brett.cannon, marco.buttu, python-dev, r.david.murray, terry.reedy, zach.ware
Date 2016-12-04.10:53:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1480848823.99.0.540966385129.issue27200@psf.upfronthosting.co.za>
In-reply-to
Content
Here is a patch that makes all Doc/library/datetime.rst doctests pass. The tests only pass with Python 3.6 and 3.7 (the optional ``timespec`` argument of ``datetime.isoformat()`` has been introduced in Python 3.6).

To apply the patch you should agree with issue 28863. In particular, to make the patch effective, as explained in issue 28863, you should:

* apply the Doc/conf.py patch of issue 28863.
* rename Doc/includes/tzinfo-examples.py to Doc/includes/tzinfo_examples.py

About the Raymond disappointment expressed in #10225, I see two ways to make both Raymond happy and the code examples tested. For the examples included from Doc/includes, using the ``literalinclude`` Sphinx directive, we can just add the Doc/includes path in Doc/conf.py (see issue 28863). At this point we can import them in the shell code examples (or in the ``setupcode``). In the datetime.rst.patch in attachment, I make use of this solution. Another option, for short snippets of code, not included from Doc/includes, is to use the ``testcode`` Sphinx directive.
History
Date User Action Args
2016-12-04 10:53:44marco.buttusetrecipients: + marco.buttu, brett.cannon, terry.reedy, r.david.murray, python-dev, berker.peksag, zach.ware, Jelle Zijlstra
2016-12-04 10:53:43marco.buttusetmessageid: <1480848823.99.0.540966385129.issue27200@psf.upfronthosting.co.za>
2016-12-04 10:53:43marco.buttulinkissue27200 messages
2016-12-04 10:53:43marco.buttucreate