Revert "gh-114275: Revert "gh-108303: Move all doctest related files … · python/cpython@973510f · GitHub
Skip to content

Commit 973510f

Browse files
committed
Revert "gh-114275: Revert "gh-108303: Move all doctest related files and tests to Lib/test/test_doctest/ (#112109)""
This reverts commit c3701e9.
1 parent c3701e9 commit 973510f

18 files changed

Lines changed: 153 additions & 117 deletions

Doc/library/doctest.rst

Lines changed: 1 addition & 1 deletion

Lib/test/libregrtest/findtests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
SPLITTESTDIRS: set[TestName] = {
2020
"test_asyncio",
2121
"test_concurrent_futures",
22+
"test_doctests",
2223
"test_future_stmt",
2324
"test_gdb",
2425
"test_inspect",

Lib/test/support/pty_helper.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,23 @@ def terminate(proc):
5858
input = b"" # Stop writing
5959
if not input:
6060
sel.modify(master, selectors.EVENT_READ)
61+
62+
63+
######################################################################
64+
## Fake stdin (for testing interactive debugging)
65+
######################################################################
66+
67+
class FakeInput:
68+
"""
69+
A fake input stream for pdb's interactive debugger. Whenever a
70+
line is read, print it (to simulate the user typing it), and then
71+
return it. The set of lines to return is specified in the
72+
constructor; they should not have trailing newlines.
73+
"""
74+
def __init__(self, lines):
75+
self.lines = lines
76+
77+
def readline(self):
78+
line = self.lines.pop(0)
79+
print(line)
80+
return line + '\n'

Lib/test/test_doctest/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import os
2+
from test.support import load_package_tests
3+
4+
def load_tests(*args):
5+
return load_package_tests(os.path.dirname(__file__), *args)
Lines changed: 2 additions & 2 deletions
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)