cpython/Lib/test/test_doctest
Sanyam Khurana 100e316e53
gh-69113: Fix doctest to report line numbers for __test__ strings (#141624)
Enhanced the _find_lineno method in doctest to correctly identify and
report line numbers for doctests defined in __test__ dictionaries when
formatted as triple-quoted strings.

Finds a non-blank line in the test string and matches it in the source
file, verifying subsequent lines also match to handle duplicate lines.

Previously, doctest would report "line None" for __test__ dictionary
strings, making it difficult to debug failing tests.

Co-authored-by: Jurjen N.E. Bos <jneb@users.sourceforge.net>
Co-authored-by: R. David Murray <rdmurray@bitdance.com>
2025-12-06 15:47:08 -05:00
..
__init__.py
decorator_mod.py
doctest_aliases.py
doctest_lineno.py gh-136914: Fix support of cached functions and properties in DocTest's lineno computation (GH-136930) 2025-07-25 12:46:12 +03:00
sample_doctest.py
sample_doctest_errors.py gh-108885: Imporove tests for doctest (GH-134832) 2025-05-28 20:14:56 +03:00
sample_doctest_no_docstrings.py
sample_doctest_no_doctests.py
sample_doctest_skip.py
test_doctest.py gh-69113: Fix doctest to report line numbers for __test__ strings (#141624) 2025-12-06 15:47:08 -05:00
test_doctest.txt
test_doctest2.py
test_doctest2.txt
test_doctest3.txt
test_doctest4.txt
test_doctest_errors.txt gh-108885: Imporove tests for doctest (GH-134832) 2025-05-28 20:14:56 +03:00
test_doctest_skip.txt gh-108885: Imporove tests for doctest (GH-134832) 2025-05-28 20:14:56 +03:00
test_doctest_skip2.txt gh-108885: Imporove tests for doctest (GH-134832) 2025-05-28 20:14:56 +03:00