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