Skip to content

Commit 0f59808

Browse files
committed
unittests test_queue skip if threads not enabled
1 parent 279614c commit 0f59808

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

graalpython/lib-python/3/test/test_queue.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ def test_queue_task_done(self):
184184
else:
185185
self.fail("Did not detect task count going negative")
186186

187+
@unittest.skipIfGraalPythonWitoutThreads
187188
def test_queue_join(self):
188189
# Test that a queue join()s successfully, and before anything else
189190
# (done twice for insurance).

graalpython/lib-python/3/unittest/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,11 @@ def load_tests(loader, tests, pattern):
8181

8282
def skipIfGraalPython(reason="Functionality not yet supported"):
8383
return skipIf(sys.implementation.name == 'graalpython', reason)
84+
85+
86+
def skipIfGraalPythonWitoutThreads(reason="Threading not yet enabled"):
87+
try:
88+
import _sysconfig as syscfg
89+
except Exception:
90+
import sysconfig as syscfg
91+
return skipIf(sys.implementation.name == 'graalpython' and not syscfg.get_config_var('WITH_THREAD'), reason)

0 commit comments

Comments
 (0)