-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-27200: fix unittest.mock doctests. #821
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
@marco-buttu, thanks for your PR! By analyzing the history of the files in this pull request, we identified @mfoord, @birkenfeld and @tiran to be potential reviewers. |
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.
IMO, this is too much work for a little gain. I prefer to skip unittest.mock altogether instead of adding too much code just to make tests runnable by doctest.
Ok @berkerpeksag, I skip all tests that do not pass, just adding some missed imports |
That sounds better, thanks! Did you push your changes or should I wait for a bit? |
I think I will need a couple of hours to finish the job. I will tag you when it is ready. Thanks :-) |
@berkerpeksag, it is done but we have a problem :( Skipping the tests that do not pass, we touch a lot of lines, more than in the previous version:
That is because a lot of examples are chained, and when we skip one of them, we need to skip all next examples that use the names defined in the skipped test. And bacause we are skipping the examples using the |
@berkerpeksag I aligned |
@berkerpeksag Do you have time to give this another review? |
Thank you for working on this, @marco-buttu. Sorry, I missed this one earlier. I agree that the last version creates too much noise in the diff. Reading the conversation again, I wonder if we should skip converting If I recall correctly, there was some discussions to reorganize mock docs and make them more compatible with our general documentation guidelines (because we basically copy & pasted them without making too much changes when we initially added mock to stdlib) so I'm beginning to think that the doctest conversion should be next step after the reorganization is done. How do you plan to integrate doctests into Travis CI? Is it hard to skip |
@berkerpeksag as you prefere. If you want us to first work on the new version before fixing the doctests, it is also fine to me. About how to integrate doctests into Travis CI, I am not an expert of Travis CI... I just thought it was as easy as adding the
|
To try and help move older pull requests forward, we are going through and backfilling 'awaiting' labels on pull requests that are lacking the label. Based on the current reviews, the best we can tell in an automated fashion is that a core developer requested changes to be made to this pull request. If/when the requested changes have been made, please leave a comment that says, |
Hi @marco-buttu, @matrixise authored 859c068 which also fixes unittest.mock.rst, so I'm closing this PR. @matrixise also enforced the doctests in travis-ci so you'll be happy: it whould never break again :) BTW thanks for all previous PR initiating this long work 🍰 |
This PR is the last one in the series bpo-27200. The other PRs were: #240, #401, #604, and #616. After applying all PRs in the series, all doctests will pass. At this point we can add the doctest check in the build.
To run the doctests (from the
Doc
directory):