Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a4ad7a0

Browse filesBrowse files
authored
[3.11] gh-108303: Move all doctest related files and tests to Lib/test/test_doctest/ (GH-112109) (#114313)
gh-108303: Move all doctest related files and tests to `Lib/test/test_doctest/` (GH-112109)
1 parent ac4c6ef commit a4ad7a0
Copy full SHA for a4ad7a0

18 files changed

+153
-118
lines changed

‎Doc/library/doctest.rst

Copy file name to clipboardExpand all lines: Doc/library/doctest.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ That's all you need to know to start making productive use of :mod:`doctest`!
134134
Jump in. The following sections provide full details. Note that there are many
135135
examples of doctests in the standard Python test suite and libraries.
136136
Especially useful examples can be found in the standard test file
137-
:file:`Lib/test/test_doctest.py`.
137+
:file:`Lib/test/test_doctest/test_doctest.py`.
138138

139139

140140
.. _doctest-simple-testmod:

‎Lib/test/libregrtest/findtests.py

Copy file name to clipboardExpand all lines: Lib/test/libregrtest/findtests.py
+1Lines 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

Copy file name to clipboardExpand all lines: Lib/test/support/pty_helper.py
+20Lines 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

Copy file name to clipboard
+5Lines 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)
File renamed without changes.

‎Lib/test/sample_doctest.py renamed to ‎Lib/test/test_doctest/sample_doctest.py

Copy file name to clipboardExpand all lines: Lib/test/test_doctest/sample_doctest.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def bar():
3232
def test_silly_setup():
3333
"""
3434
35-
>>> import test.test_doctest
36-
>>> test.test_doctest.sillySetup
35+
>>> import test.test_doctest.test_doctest
36+
>>> test.test_doctest.test_doctest.sillySetup
3737
True
3838
"""
3939

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.