-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-27200: fix configparser, copyreg and ctypes doctests #240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Doc/library/configparser.rst
Outdated
@@ -42,6 +42,11 @@ can be customized by end users easily. | |||
be used for this purpose. | |||
|
|||
|
|||
.. testsetup:: | |||
|
|||
import configparser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation should use three spaces here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, you are right
Doc/library/ctypes.rst
Outdated
@@ -1408,6 +1408,10 @@ accessing the function through an attribute caches the result and therefore | |||
accessing it repeatedly returns the same object each time. On the other hand, | |||
accessing it through an index returns a new object each time: | |||
|
|||
.. doctest:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find your version much clearer, +1. However, I don't see much point converting this to a doctest. I'd say remove .. doctest::
and keep the rest of the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the doctest
directive. However, there is one point for taking it: in some editors, if you use the ::
before the example you enable the syntax hightligh for the example, but the example will not be doctested. If you use just the :
, you lose the syntax highligh but the example will be doctested. If you eventually use the doctest
directive, you have both syntax highlight and doctest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I didn't mentioned it because I assumed you are going to change "[...] each time:" to "[...] each time::" :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@berkerpeksag, it was "[...] each time:" from the beginning, I did not change it. Do you still want to change it anyway? Sorry for all these questions :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please change it to "[...] each time::".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, done. Thank you! :-)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 4.5.0 to 4.6.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst) - [Commits](pytest-dev/pytest@4.5.0...4.6.1)
This PR patially fixes bpo-27200. Partially and not completely, because I followed the suggestion of @ezio-melotti to split the patch in several patches. According to @rhettinger I applyed minimal changes, skipping some tests instead of using
sorted()
. I just want to point out that the two<BLANKLINE>
and thetestsetup
dicrective will not appear in the output.