Fix test failure in debug builds and add NEWS entry for r86908

This commit is contained in:
Ezio Melotti 2010-12-01 01:45:53 +00:00
parent 6090187656
commit f10c400b91
2 changed files with 5 additions and 3 deletions

View File

@ -266,7 +266,7 @@ class Test_TextTestRunner(unittest.TestCase):
# no args -> all the warnings are printed, unittest warnings only once # no args -> all the warnings are printed, unittest warnings only once
p = subprocess.Popen([sys.executable, '_test_warnings.py'], **opts) p = subprocess.Popen([sys.executable, '_test_warnings.py'], **opts)
out, err = get_parse_out_err(p) 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 # check that the total number of warnings in the output is correct
self.assertEqual(len(out), 12) self.assertEqual(len(out), 12)
# check that the numbers of the different kind of warnings is correct # 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: for args in args_list:
p = subprocess.Popen(args, **opts) p = subprocess.Popen(args, **opts)
out, err = get_parse_out_err(p) out, err = get_parse_out_err(p)
self.assertEqual(err[-1], b'OK') self.assertIn(b'OK', err)
self.assertEqual(len(out), 0) self.assertEqual(len(out), 0)
@ -296,7 +296,7 @@ class Test_TextTestRunner(unittest.TestCase):
p = subprocess.Popen([sys.executable, '_test_warnings.py', 'always'], p = subprocess.Popen([sys.executable, '_test_warnings.py', 'always'],
**opts) **opts)
out, err = get_parse_out_err(p) out, err = get_parse_out_err(p)
self.assertEqual(err[-1], b'OK') self.assertIn(b'OK', err)
self.assertEqual(len(out), 14) self.assertEqual(len(out), 14)
for msg in [b'dw', b'iw', b'uw', b'rw']: for msg in [b'dw', b'iw', b'uw', b'rw']:
self.assertEqual(out.count(msg), 3) self.assertEqual(out.count(msg), 3)

View File

@ -46,6 +46,8 @@ Core and Builtins
Library Library
------- -------
- Issue #10535: Enable silenced warnings in unittest by default.
- Issue #9873: The URL parsing functions in urllib.parse now accept - Issue #9873: The URL parsing functions in urllib.parse now accept
ASCII byte sequences as input in addition to character strings. ASCII byte sequences as input in addition to character strings.