aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_exception_group.py
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2021-12-21 10:12:26 +0000
committerGitHub <noreply@github.com>2021-12-21 10:12:26 +0000
commitc66fc0fb53b5316dc325fde3bc738890515d38a4 (patch)
treecefb4f322fcd005b46c3a817918ef92e5eae4d2b /Lib/test/test_exception_group.py
parente9a01e231aae19fd1249368e477a60bc033b2646 (diff)
downloadcpython-c66fc0fb53b5316dc325fde3bc738890515d38a4.tar.gz
cpython-c66fc0fb53b5316dc325fde3bc738890515d38a4.zip
bpo-46107: ExceptionGroup.subgroup()/split() should copy __note__ to the parts (GH-30159)
Diffstat (limited to 'Lib/test/test_exception_group.py')
-rw-r--r--Lib/test/test_exception_group.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_exception_group.py b/Lib/test/test_exception_group.py
index c793c45e724..f0ae37741ab 100644
--- a/Lib/test/test_exception_group.py
+++ b/Lib/test/test_exception_group.py
@@ -495,13 +495,14 @@ class ExceptionGroupSplitTestBase(ExceptionGroupTestBase):
match and e in match_leaves,
rest and e in rest_leaves)
- # message, cause and context equal to eg
+ # message, cause and context, traceback and note equal to eg
for part in [match, rest, sg]:
if part is not None:
self.assertEqual(eg.message, part.message)
self.assertIs(eg.__cause__, part.__cause__)
self.assertIs(eg.__context__, part.__context__)
self.assertIs(eg.__traceback__, part.__traceback__)
+ self.assertIs(eg.__note__, part.__note__)
def tbs_for_leaf(leaf, eg):
for e, tbs in leaf_generator(eg):
@@ -566,6 +567,7 @@ class NestedExceptionGroupSplitTest(ExceptionGroupSplitTestBase):
try:
nested_group()
except ExceptionGroup as e:
+ e.__note__ = f"the note: {id(e)}"
eg = e
eg_template = [