mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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:
parent
2ff072f21f
commit
9c93350f58
18 changed files with 153 additions and 117 deletions
|
@ -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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue