mirror of
https://github.com/python/cpython.git
synced 2025-09-09 18:32:22 +00:00
Allow "-j0" as an argument to regrtest, to automatically select an
appropriate number of parallel workers.
This commit is contained in:
parent
5066b03361
commit
6ab79d9d5b
1 changed files with 7 additions and 0 deletions
|
@ -374,6 +374,13 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
|
||||||
forever = True
|
forever = True
|
||||||
elif o in ('-j', '--multiprocess'):
|
elif o in ('-j', '--multiprocess'):
|
||||||
use_mp = int(a)
|
use_mp = int(a)
|
||||||
|
if use_mp <= 0:
|
||||||
|
try:
|
||||||
|
import multiprocessing
|
||||||
|
# Use all cores + extras for tests that like to sleep
|
||||||
|
use_mp = 2 + multiprocessing.cpu_count()
|
||||||
|
except (ImportError, NotImplementedError):
|
||||||
|
use_mp = 3
|
||||||
elif o == '--header':
|
elif o == '--header':
|
||||||
header = True
|
header = True
|
||||||
elif o == '--slaveargs':
|
elif o == '--slaveargs':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue