whatsnew: fix unittest subtest example.
This commit is contained in:
parent
97c3642532
commit
40e1ffc78e
|
@ -1642,7 +1642,7 @@ which will run even if one or more of them fail. For example::
|
||||||
class NumbersTest(unittest.TestCase):
|
class NumbersTest(unittest.TestCase):
|
||||||
def test_even(self):
|
def test_even(self):
|
||||||
for i in range(6):
|
for i in range(6):
|
||||||
with self.subTest(i=1):
|
with self.subTest(i=i):
|
||||||
self.assertEqual(i % 2, 0)
|
self.assertEqual(i % 2, 0)
|
||||||
|
|
||||||
will result in six subtests, each identified in the unittest verbose output
|
will result in six subtests, each identified in the unittest verbose output
|
||||||
|
|
Loading…
Reference in New Issue