From b9a492b809d8765ee365a5dd3c6ba4e5130a80af Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 17 Dec 2024 16:18:33 +0800 Subject: [PATCH] gh-127085: Add a test skip if multiprocessing isn't available (#128019) 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