MCPcopy Index your code
hub / github.com/RustPython/RustPython / check_enough_semaphores

Function check_enough_semaphores

Lib/test/_test_multiprocessing.py:168–180  ·  view source on GitHub ↗

Check that the system supports enough semaphores to run the test.

()

Source from the content-addressed store, hash-verified

166
167
168def check_enough_semaphores():
169 """Check that the system supports enough semaphores to run the test."""
170 # minimum number of semaphores available according to POSIX
171 nsems_min = 256
172 try:
173 nsems = os.sysconf("SC_SEM_NSEMS_MAX")
174 except (AttributeError, ValueError):
175 # sysconf not available or setting not available
176 return
177 if nsems == -1 or nsems >= nsems_min:
178 return
179 raise unittest.SkipTest("The OS doesn't support enough semaphores "
180 "to run the test (required: %d)." % nsems_min)
181
182
183def only_run_in_spawn_testsuite(reason):

Callers 1

setUpModuleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected