gh-108303: Move all doctest related files and tests to Lib/test/test_doctest/ (#112109)

Co-authored-by: Brett Cannon <brett@python.org>
This commit is contained in:
Nikita Sobolev 2024-01-18 18:58:11 +03:00 committed by GitHub
parent 2ff072f21f
commit 9c93350f58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 153 additions and 117 deletions

View file

@ -58,3 +58,23 @@ def run_pty(script, input=b"dummy input\r", env=None):
input = b"" # Stop writing
if not input:
sel.modify(master, selectors.EVENT_READ)
######################################################################
## Fake stdin (for testing interactive debugging)
######################################################################
class FakeInput:
"""
A fake input stream for pdb's interactive debugger. Whenever a
line is read, print it (to simulate the user typing it), and then
return it. The set of lines to return is specified in the
constructor; they should not have trailing newlines.
"""
def __init__(self, lines):
self.lines = lines
def readline(self):
line = self.lines.pop(0)
print(line)
return line + '\n'