File tree Expand file tree Collapse file tree 1 file changed +20
-19
lines changed Expand file tree Collapse file tree 1 file changed +20
-19
lines changed Original file line number Diff line number Diff line change @@ -1601,25 +1601,26 @@ def __repr__(self):
1601
1601
1602
1602
def test_exception_with_multiple_notes (self ):
1603
1603
for e in [ValueError (42 ), SyntaxError ('bad syntax' )]:
1604
- vanilla = self .get_report (e )
1605
-
1606
- e .add_note ('Note 1' )
1607
- e .add_note ('Note 2' )
1608
- e .add_note ('Note 3' )
1609
-
1610
- self .assertEqual (
1611
- self .get_report (e ),
1612
- vanilla + 'Note 1\n ' + 'Note 2\n ' + 'Note 3\n ' )
1613
-
1614
- del e .__notes__
1615
- e .add_note ('Note 4' )
1616
- del e .__notes__
1617
- e .add_note ('Note 5' )
1618
- e .add_note ('Note 6' )
1619
-
1620
- self .assertEqual (
1621
- self .get_report (e ),
1622
- vanilla + 'Note 5\n ' + 'Note 6\n ' )
1604
+ with self .subTest (e = e ):
1605
+ vanilla = self .get_report (e )
1606
+
1607
+ e .add_note ('Note 1' )
1608
+ e .add_note ('Note 2' )
1609
+ e .add_note ('Note 3' )
1610
+
1611
+ self .assertEqual (
1612
+ self .get_report (e ),
1613
+ vanilla + 'Note 1\n ' + 'Note 2\n ' + 'Note 3\n ' )
1614
+
1615
+ del e .__notes__
1616
+ e .add_note ('Note 4' )
1617
+ del e .__notes__
1618
+ e .add_note ('Note 5' )
1619
+ e .add_note ('Note 6' )
1620
+
1621
+ self .assertEqual (
1622
+ self .get_report (e ),
1623
+ vanilla + 'Note 5\n ' + 'Note 6\n ' )
1623
1624
1624
1625
def test_exception_qualname (self ):
1625
1626
class A :
You can’t perform that action at this time.
0 commit comments