pytest_generate_tests remove `fork` only if it's in list

propagate_loglevel
Christian López Barrón 2019-03-09 16:45:55 +11:00
parent 8c5337c5ca
commit efffca371a
1 changed files with 2 additions and 1 deletions

View File

@ -34,5 +34,6 @@ def pytest_generate_tests(metafunc):
if 'start_method' in metafunc.fixturenames:
from multiprocessing import get_all_start_methods
methods = get_all_start_methods()
methods.remove('fork')
if 'fork' in methods: # fork not available on windows, so check before removing
methods.remove('fork')
metafunc.parametrize("start_method", methods, scope='module')