summaryrefslogtreecommitdiffstats
path: root/Lib/test/_test_multiprocessing.py
diff options
context:
space:
mode:
authorRichard Oudkerk <shibturn@gmail.com>2014-03-23 12:30:54 (GMT)
committerRichard Oudkerk <shibturn@gmail.com>2014-03-23 12:30:54 (GMT)
commit80a5be1d84689a680900ff4900acb2a39ec6d2a8 (patch)
tree7c11e5d9148ac8399a9a651e9aaf61ca2f5df576 /Lib/test/_test_multiprocessing.py
parenta40675a1a232479bbc2cb9437db265416eeb5b2d (diff)
downloadcpython-80a5be1d84689a680900ff4900acb2a39ec6d2a8.zip
cpython-80a5be1d84689a680900ff4900acb2a39ec6d2a8.tar.gz
cpython-80a5be1d84689a680900ff4900acb2a39ec6d2a8.tar.bz2
Issue #20980: Stop wrapping exception when using ThreadPool.
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r--Lib/test/_test_multiprocessing.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index 8eb57fe..44d6c71 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -1810,6 +1810,17 @@ class _TestPool(BaseTestCase):
self.assertIn('raise RuntimeError(123) # some comment',
f1.getvalue())
+ @classmethod
+ def _test_wrapped_exception(cls):
+ raise RuntimeError('foo')
+
+ def test_wrapped_exception(self):
+ # Issue #20980: Should not wrap exception when using thread pool
+ with self.Pool(1) as p:
+ with self.assertRaises(RuntimeError):
+ p.apply(self._test_wrapped_exception)
+
+
def raising():
raise KeyError("key")