summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-03-29 23:15:48 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-03-29 23:15:48 (GMT)
commit6e722bc13fbe019195e6e760abfb6c9444124b14 (patch)
tree3fa8a80cc98cbfca22806646b5829d6181866cb4
parentbbcd2946207bd9a0956b0265b09e8a4cd462682e (diff)
parent9db2ae7263d8047c29a13ad476534a4cbcdbd8f6 (diff)
downloadcpython-6e722bc13fbe019195e6e760abfb6c9444124b14.zip
cpython-6e722bc13fbe019195e6e760abfb6c9444124b14.tar.gz
cpython-6e722bc13fbe019195e6e760abfb6c9444124b14.tar.bz2
Merge 3.5 (test_unittest)
-rw-r--r--Lib/unittest/test/test_runner.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/unittest/test/test_runner.py b/Lib/unittest/test/test_runner.py
index 9cbc260..ddc498c 100644
--- a/Lib/unittest/test/test_runner.py
+++ b/Lib/unittest/test/test_runner.py
@@ -290,7 +290,8 @@ 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)
+ with p:
+ out, err = get_parse_out_err(p)
self.assertIn(b'OK', err)
# check that the total number of warnings in the output is correct
self.assertEqual(len(out), 12)
@@ -311,7 +312,8 @@ class Test_TextTestRunner(unittest.TestCase):
# in all these cases no warnings are printed
for args in args_list:
p = subprocess.Popen(args, **opts)
- out, err = get_parse_out_err(p)
+ with p:
+ out, err = get_parse_out_err(p)
self.assertIn(b'OK', err)
self.assertEqual(len(out), 0)
@@ -320,7 +322,8 @@ class Test_TextTestRunner(unittest.TestCase):
# unittest warnings only once
p = subprocess.Popen([sys.executable, '_test_warnings.py', 'always'],
**opts)
- out, err = get_parse_out_err(p)
+ with p:
+ out, err = get_parse_out_err(p)
self.assertIn(b'OK', err)
self.assertEqual(len(out), 14)
for msg in [b'dw', b'iw', b'uw', b'rw']: