]> granicus.if.org Git - python/commitdiff
whatsnew: fix unittest subtest example.
authorR David Murray <rdmurray@bitdance.com>
Wed, 12 Mar 2014 13:31:50 +0000 (09:31 -0400)
committerR David Murray <rdmurray@bitdance.com>
Wed, 12 Mar 2014 13:31:50 +0000 (09:31 -0400)
Doc/whatsnew/3.4.rst

index c12c4bf52ab62bfa4eea706d48c887457e25bb88..873398cbe2e226872ef18125923ee34628642330 100644 (file)
@@ -1642,7 +1642,7 @@ which will run even if one or more of them fail.  For example::
     class NumbersTest(unittest.TestCase):
         def test_even(self):
             for i in range(6):
-                with self.subTest(i=1):
+                with self.subTest(i=i):
                     self.assertEqual(i % 2, 0)
 
 will result in six subtests, each identified in the unittest verbose output