mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00

gh-108303: Move all doctest related files and tests to `Lib/test/test_doctest/` (GH-112109)
(cherry picked from commit 9c93350f58
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Brett Cannon <brett@python.org>
17 lines
300 B
Text
17 lines
300 B
Text
This is a sample doctest in a text file.
|
|
|
|
In this example, we'll rely on a global variable being set for us
|
|
already:
|
|
|
|
>>> favorite_color
|
|
'blue'
|
|
|
|
We can make this fail by disabling the blank-line feature.
|
|
|
|
>>> if 1:
|
|
... print('a')
|
|
... print()
|
|
... print('b')
|
|
a
|
|
<BLANKLINE>
|
|
b
|