whatsnew: fix unittest subtest example.

This commit is contained in:
R David Murray 2014-03-12 09:31:50 -04:00
parent 97c3642532
commit 40e1ffc78e
1 changed files with 1 additions and 1 deletions

View File

@ -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