From 96df8a8fdacfb68ddb52e53394d462763c92cd2f Mon Sep 17 00:00:00 2001 From: hugovk Date: Wed, 15 Nov 2017 22:22:52 +0200 Subject: [PATCH] Test with multiprocessing --- test-installed.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test-installed.py b/test-installed.py index 7269b3494..35a3b4ccc 100755 --- a/test-installed.py +++ b/test-installed.py @@ -14,19 +14,18 @@ sys.path.insert(0, os.path.abspath('./Tests')) # Something is required, because if we import the tests from the local # directory, once again, we've got the non-installed PIL in the way for i, arg in enumerate(sys.argv[1:]): - print(i, arg) if arg.startswith('Tests/test_') and arg.endswith('.py'): - print("bingo") sys.argv.insert(i+1, '-k') break else: sys.argv.append('Tests') -# for arg in sys.argv: -# if '-n' in arg or '--numprocesses' in arg: -# break -# else: # for -# sys.argv.extend(['--numprocesses' ,'auto']) # auto-detect number of CPUs +for arg in sys.argv: + if '-n' in arg or '--numprocesses' in arg: + break +else: # for + sys.argv.extend(['--numprocesses', 'auto']) # auto-detect number of CPUs + if __name__ == '__main__': pytest.main()