https://github.com/python/cpython/commit/2b2cf81a6c84d24b9d669716d0fdccb923801941
commit: 2b2cf81a6c84d24b9d669716d0fdccb923801941
branch: 3.14
author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
committer: gpshead <68491+gpsh...@users.noreply.github.com>
date: 2025-07-05T11:24:19-07:00
summary:

[3.14] gh-136315: Fix skipped multithreading test in test_zstd (GH-136320) 
(#136322)

gh-136315: Fix skipped multithreading test in test_zstd (GH-136320)

Fix skipped test in test_zstd
(cherry picked from commit 5dac137b9f75c5c1d5096101bcd33d565d0526e4)

Co-authored-by: Emma Smith <e...@emmatyping.dev>

files:
M Lib/test/test_zstd.py

diff --git a/Lib/test/test_zstd.py b/Lib/test/test_zstd.py
index 7bd0ffd9391529..e83caaf4c07b13 100644
--- a/Lib/test/test_zstd.py
+++ b/Lib/test/test_zstd.py
@@ -63,15 +63,18 @@
 
 TRAINED_DICT = None
 
-SUPPORT_MULTITHREADING = False
+# Cannot be deferred to setup as it is used to check whether or not to skip
+# tests
+try:
+    SUPPORT_MULTITHREADING = CompressionParameter.nb_workers.bounds() != (0, 0)
+except Exception:
+    SUPPORT_MULTITHREADING = False
 
 C_INT_MIN = -(2**31)
 C_INT_MAX = (2**31) - 1
 
 
 def setUpModule():
-    global SUPPORT_MULTITHREADING
-    SUPPORT_MULTITHREADING = CompressionParameter.nb_workers.bounds() != (0, 0)
     # uncompressed size 130KB, more than a zstd block.
     # with a frame epilogue, 4 bytes checksum.
     global DAT_130K_D

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: arch...@mail-archive.com

Reply via email to