]> granicus.if.org Git - python/commitdiff
Fix test failure in debug builds and add NEWS entry for r86908
authorEzio Melotti <ezio.melotti@gmail.com>
Wed, 1 Dec 2010 01:45:53 +0000 (01:45 +0000)
committerEzio Melotti <ezio.melotti@gmail.com>
Wed, 1 Dec 2010 01:45:53 +0000 (01:45 +0000)
Lib/unittest/test/test_runner.py
Misc/NEWS

index efd4962a1d24f81787af2d6c8e37efee91ce5765..8f4aaaa5ba226c7089941ecf9132ef3d73371f52 100644 (file)
@@ -266,7 +266,7 @@ class Test_TextTestRunner(unittest.TestCase):
         # no args -> all the warnings are printed, unittest warnings only once
         p = subprocess.Popen([sys.executable, '_test_warnings.py'], **opts)
         out, err = get_parse_out_err(p)
-        self.assertEqual(err[-1], b'OK')
+        self.assertIn(b'OK', err)
         # check that the total number of warnings in the output is correct
         self.assertEqual(len(out), 12)
         # check that the numbers of the different kind of warnings is correct
@@ -287,7 +287,7 @@ class Test_TextTestRunner(unittest.TestCase):
         for args in args_list:
             p = subprocess.Popen(args, **opts)
             out, err = get_parse_out_err(p)
-            self.assertEqual(err[-1], b'OK')
+            self.assertIn(b'OK', err)
             self.assertEqual(len(out), 0)
 
 
@@ -296,7 +296,7 @@ class Test_TextTestRunner(unittest.TestCase):
         p = subprocess.Popen([sys.executable, '_test_warnings.py', 'always'],
                              **opts)
         out, err = get_parse_out_err(p)
-        self.assertEqual(err[-1], b'OK')
+        self.assertIn(b'OK', err)
         self.assertEqual(len(out), 14)
         for msg in [b'dw', b'iw', b'uw', b'rw']:
             self.assertEqual(out.count(msg), 3)
index 6d8371c8633333c32f977955c2a1191cc952e81e..4598ca7d8da3ebb51bd5375b119b60b462a447b3 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -46,6 +46,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #10535: Enable silenced warnings in unittest by default.
+
 - Issue #9873: The URL parsing functions in urllib.parse now accept
   ASCII byte sequences as input in addition to character strings.