[Python-checkins] cpython: whatsnew: fix unittest subtest example.

r.david.murray python-checkins at python.org
Thu Mar 13 16:04:42 CET 2014


http://hg.python.org/cpython/rev/9c641c97db36
changeset: 89632:9c641c97db36
user: R David Murray <rdmurray at bitdance.com>
date: Wed Mar 12 09:31:50 2014 -0400
summary:
 whatsnew: fix unittest subtest example.
files:
 Doc/whatsnew/3.4.rst | 2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst
--- a/Doc/whatsnew/3.4.rst
+++ b/Doc/whatsnew/3.4.rst
@@ -1642,7 +1642,7 @@
 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
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /