Skip to content

Commit d54aafd

Browse files
emmatypingtaegyunkim
authored andcommitted
pythongh-136315: Fix skipped multithreading test in test_zstd (python#136320)
Fix skipped test in test_zstd
1 parent 277325d commit d54aafd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Lib/test/test_zstd.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,18 @@
6262

6363
TRAINED_DICT = None
6464

65-
SUPPORT_MULTITHREADING = False
65+
# Cannot be deferred to setup as it is used to check whether or not to skip
66+
# tests
67+
try:
68+
SUPPORT_MULTITHREADING = CompressionParameter.nb_workers.bounds() != (0, 0)
69+
except Exception:
70+
SUPPORT_MULTITHREADING = False
6671

6772
C_INT_MIN = -(2**31)
6873
C_INT_MAX = (2**31) - 1
6974

7075

7176
def setUpModule():
72-
global SUPPORT_MULTITHREADING
73-
SUPPORT_MULTITHREADING = CompressionParameter.nb_workers.bounds() != (0, 0)
7477
# uncompressed size 130KB, more than a zstd block.
7578
# with a frame epilogue, 4 bytes checksum.
7679
global DAT_130K_D

0 commit comments

Comments
 (0)