mirror of
https://github.com/python/cpython.git
synced 2025-12-04 16:43:27 +00:00
test_DocTestFinder(): This test failed when test_doctest was run
directly, due to assuming a filename specific to running tests "the normal way". +ELLIPSIS to the rescue!
This commit is contained in:
parent
a7def72a08
commit
4de7c5c103
1 changed files with 5 additions and 2 deletions
|
|
@ -280,8 +280,11 @@ We'll simulate a __file__ attr that ends in pyc:
|
||||||
>>> print tests # doctest: +ELLIPSIS
|
>>> print tests # doctest: +ELLIPSIS
|
||||||
[<DocTest sample_func from ...:13 (1 example)>]
|
[<DocTest sample_func from ...:13 (1 example)>]
|
||||||
|
|
||||||
>>> tests[0].filename
|
The exact name depends on how test_doctest was invoked, so allow for
|
||||||
'test_doctest.py'
|
leading path components.
|
||||||
|
|
||||||
|
>>> tests[0].filename # doctest: +ELLIPSIS
|
||||||
|
'...test_doctest.py'
|
||||||
|
|
||||||
>>> test.test_doctest.__file__ = old
|
>>> test.test_doctest.__file__ = old
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue