[Python-checkins] cpython (2.7): Issue #23713: Fixed fragility of test_imap_unordered_handle_iterable_exception.
serhiy.storchaka
python-checkins at python.org
Thu Apr 23 10:37:22 CEST 2015
https://hg.python.org/cpython/rev/0ac30526c208
changeset: 95781:0ac30526c208
branch: 2.7
parent: 95778:9e47ed690e75
user: Serhiy Storchaka <storchaka at gmail.com>
date: Thu Apr 23 11:35:43 2015 +0300
summary:
Issue #23713: Fixed fragility of test_imap_unordered_handle_iterable_exception.
Patch by Davin Potts.
files:
Lib/test/test_multiprocessing.py | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -1219,17 +1219,23 @@
it = self.pool.imap_unordered(sqr,
exception_throwing_generator(10, 3),
1)
+ expected_values = map(sqr, range(10))
with self.assertRaises(SayWhenError):
# imap_unordered makes it difficult to anticipate the SayWhenError
for i in range(10):
- self.assertEqual(next(it), i*i)
+ value = next(it)
+ self.assertIn(value, expected_values)
+ expected_values.remove(value)
it = self.pool.imap_unordered(sqr,
exception_throwing_generator(20, 7),
2)
+ expected_values = map(sqr, range(20))
with self.assertRaises(SayWhenError):
for i in range(20):
- self.assertEqual(next(it), i*i)
+ value = next(it)
+ self.assertIn(value, expected_values)
+ expected_values.remove(value)
def test_make_pool(self):
self.assertRaises(ValueError, multiprocessing.Pool, -1)
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list