[Python-checkins] cpython (3.4): 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/0eb5968c15ad
changeset: 95782:0eb5968c15ad
branch: 3.4
parent: 95779:2d7e9a0418f2
user: Serhiy Storchaka <storchaka at gmail.com>
date: Thu Apr 23 11:35:59 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
@@ -1799,17 +1799,23 @@
it = self.pool.imap_unordered(sqr,
exception_throwing_generator(10, 3),
1)
+ expected_values = list(map(sqr, list(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 = list(map(sqr, list(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