From 031e3b31977e4d815c6523e5648c45183f4d9394 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 17 Dec 2024 15:32:12 +0800 Subject: [PATCH] Add a test skip if multiprocessing isn't available. --- Lib/test/test_memoryview.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_memoryview.py b/Lib/test/test_memoryview.py index 856e17918048e4..61b068c630c7ce 100644 --- a/Lib/test/test_memoryview.py +++ b/Lib/test/test_memoryview.py @@ -739,7 +739,10 @@ def test_picklebuffer_reference_loop(self): class RacingTest(unittest.TestCase): def test_racing_getbuf_and_releasebuf(self): """Repeatly access the memoryview for racing.""" - from multiprocessing.managers import SharedMemoryManager + try: + from multiprocessing.managers import SharedMemoryManager + except ImportError: + self.skipTest("Test requires multiprocessing") from threading import Thread n = 100