GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||
GeezerVison is showing github.com — gh-108303: Move all doctest related files and tests to `Lib/test/test_doctest/` by sobolevn · Pull Request #112109 · python/cpython Conversation
|
| self.lines = lines | ||
|
|
||
| def readline(self): | ||
| line = self.lines.pop(0) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Calling list.pop(0) frequently is inefficient. Maybe the constructor should create a collections.deque() and call self.lines.popleft() instead?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It is usually used in cases like sys.stdin = FakeInput(['next', 'print(x)', 'continue']), I don't think it matters much. But, I can do this if you want :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Brett Cannon <[email protected]>
|
I solved merge conflicts, cc @vstinner |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Since we are moving code, would it be worth it to split test_doctest.py which has 3 374 lines into multiple files? I found the following tests / test cases:
For example, it would be nice to have 1000 lines or less per file. If you are interested to make such change, I suggest creating a new PR, so we can compare. About test_doctest2: why is it a separated file? Should it be renamed? The docstring says:
I suppose that 2.2 stands for Python 2.2. Is it a test on the "parser" or "test discovery"? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I don't think so, because moving a file is a rather simple operation. It does not spoil I work with
I agree that the naming of this file is not optimal. It also clashes with Looks like that all tests from it are just duplicates. We already test classes, classmethods, staticmethods and everything else in It has some details that I want to explicitly port:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I cannot see where Lib/test/test_doctest2.py test goes. Did you just remove it?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yes:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I'm not convinced that test_doctest2 is useless. It calls """... We include some (random) encoded (utf-8) text in the text surrounding the example. It should be ignored: ЉЊЈЁЂ """ It runs tests in verbose mode instead of running them in quiet mode:
Even we agree that test_doctest2 is useless, I would prefer to not include this silent removal in the middle of such huge refactoring (move all tests code). Please add back test_doctest2.py in the new test_doctest/ directory. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…t/test_doctest/` (pythonGH-112109) (cherry picked from commit 9c93350) Co-authored-by: Nikita Sobolev <[email protected]> Co-authored-by: Brett Cannon <[email protected]>
|
GH-114254 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @sobolevn and @vstinner, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Merged, thanks. @sobolevn: The automated backport to 3.11 failed, do you want to attempt to backport the change to 3.11 manually? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…st/test_doctest/` (GH-112109) (#114254) gh-108303: Move all doctest related files and tests to `Lib/test/test_doctest/` (GH-112109) (cherry picked from commit 9c93350) Co-authored-by: Nikita Sobolev <[email protected]> Co-authored-by: Brett Cannon <[email protected]>
|
Sure thing! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
FYI this broke the WASI builds; https://buildbot.python.org/all/#/builders/1046/builds/4033 and https://buildbot.python.org/all/#/builders/1124/builds/623 . |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…les and tests to `Lib/test/test_doctest/` (python#112109)" This reverts commit 9c93350.
…lated files and tests to `Lib/test/test_doctest/` (python#112109)"" This reverts commit c3701e9.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-114313 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…t/test_doctest/` (python#112109) Co-authored-by: Brett Cannon <[email protected]>
…t/test_doctest/` (python#112109) Co-authored-by: Brett Cannon <[email protected]>
…t/test_doctest/` (python#112109) Co-authored-by: Brett Cannon <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.