» ./python.exe -m doctest ex.py
**********************************************************************
File "/Users/sobolev/Desktop/cpython/ex.py", line 4, in ex
Failed example:
raise_with_note()
Expected:
Traceback (most recent call last):
...
ValueError: Text
Note
Got:
Traceback (most recent call last):
File "/Users/sobolev/Desktop/cpython/Lib/doctest.py", line 1374, in __run
exec(compile(example.source, filename, "single",
File "<doctest ex[0]>", line 1, in <module>
raise_with_note()
File "/Users/sobolev/Desktop/cpython/ex.py", line 14, in raise_with_note
raise err
ValueError: Text
Note
**********************************************************************
1 items had failures:
1 of 1 in ex
***Test Failed*** 1 failures.
Bug report
Minimal reproducer:
Now, run it, you will get a very strange error:
Things that do not help:
IGNORE_EXCEPTION_DETAILELLIPSISRelated to how exceptions with notes are represented in
cpython/Lib/doctest.py
Line 1396 in 7237fb5
I am working on this issue right now :)
Refs #111157
Linked PRs
doctestoutput comparison for exceptions with notes #111160doctestoutput comparison for exceptions with notes (GH-111160) #111169doctestoutput comparison for exceptions with notes (GH-111160) #111170SyntaxErrordoctests for non-builtin exception classes #111541SyntaxErrordoctests for non-builtin exception classes (GH-111541) #111732SyntaxErrordoctests for non-builtin exception classes (GH-111541) #111733