mirror of
https://github.com/python/cpython.git
synced 2025-08-17 07:11:51 +00:00
[3.12] gh-94722: fix DocTest.__eq__ for case of no line number on one side (GH-112385) (#112400)
gh-94722: fix DocTest.__eq__ for case of no line number on one side (GH-112385)
(cherry picked from commit fbb9027a03
)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
parent
44eb329490
commit
e93af80749
3 changed files with 23 additions and 2 deletions
|
@ -414,6 +414,23 @@ Compare `DocTest`:
|
|||
False
|
||||
>>> test != other_test
|
||||
True
|
||||
>>> test < other_test
|
||||
False
|
||||
>>> other_test < test
|
||||
True
|
||||
|
||||
Test comparison with lineno None on one side
|
||||
|
||||
>>> no_lineno = parser.get_doctest(docstring, globs, 'some_test',
|
||||
... 'some_test', None)
|
||||
>>> test.lineno is None
|
||||
False
|
||||
>>> no_lineno.lineno is None
|
||||
True
|
||||
>>> test < no_lineno
|
||||
False
|
||||
>>> no_lineno < test
|
||||
True
|
||||
|
||||
Compare `DocTestCase`:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue