diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2014-03-23 12:30:54 (GMT) |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2014-03-23 12:30:54 (GMT) |
commit | 80a5be1d84689a680900ff4900acb2a39ec6d2a8 (patch) | |
tree | 7c11e5d9148ac8399a9a651e9aaf61ca2f5df576 /Lib/test/_test_multiprocessing.py | |
parent | a40675a1a232479bbc2cb9437db265416eeb5b2d (diff) | |
download | cpython-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.py | 11 |
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") |