summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_doctest.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_doctest.py')
-rw-r--r--Lib/test/test_doctest.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py
index 5c59b00..cb4e215 100644
--- a/Lib/test/test_doctest.py
+++ b/Lib/test/test_doctest.py
@@ -3310,6 +3310,24 @@ def test_syntax_error_with_note(cls, multiline=False):
raise exc
+def test_syntax_error_subclass_from_stdlib():
+ """
+ `ParseError` is a subclass of `SyntaxError`, but it is not a builtin:
+
+ >>> test_syntax_error_subclass_from_stdlib()
+ Traceback (most recent call last):
+ ...
+ xml.etree.ElementTree.ParseError: error
+ error
+ Note
+ Line
+ """
+ from xml.etree.ElementTree import ParseError
+ exc = ParseError("error\nerror")
+ exc.add_note('Note\nLine')
+ raise exc
+
+
def test_syntax_error_with_incorrect_expected_note():
"""
>>> def f(x):