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>
S
Sanyam Khurana committed
100e316e53abfff45f2a94987ee7a8622fcd3589
Parent: c91c373
Committed by GitHub <noreply@github.com>
on 12/6/2025, 8:47:08 PM