summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/_test_multiprocessing.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index 083ad536a0..dd894f21f7 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -5244,6 +5244,20 @@ class TestSimpleQueue(unittest.TestCase):
proc.join()
+ def test_close(self):
+ queue = multiprocessing.SimpleQueue()
+ queue.close()
+ # closing a queue twice should not fail
+ queue.close()
+
+ # Test specific to CPython since it tests private attributes
+ @test.support.cpython_only
+ def test_closed(self):
+ queue = multiprocessing.SimpleQueue()
+ queue.close()
+ self.assertTrue(queue._reader.closed)
+ self.assertTrue(queue._writer.closed)
+
class TestPoolNotLeakOnFailure(unittest.TestCase):