summaryrefslogtreecommitdiffstats
path: root/Lib/test/_test_multiprocessing.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r--Lib/test/_test_multiprocessing.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index 0b0fe7c..a2dc53c 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -2561,6 +2561,22 @@ class _TestPool(BaseTestCase):
# they were released too.
self.assertEqual(CountedObject.n_instances, 0)
+ def test_enter(self):
+ if self.TYPE == 'manager':
+ self.skipTest("test not applicable to manager")
+
+ pool = self.Pool(1)
+ with pool:
+ pass
+ # call pool.terminate()
+ # pool is no longer running
+
+ with self.assertRaises(ValueError):
+ # bpo-35477: pool.__enter__() fails if the pool is not running
+ with pool:
+ pass
+ pool.join()
+
def raising():
raise KeyError("key")