'Make test' calls 'pytest -qq' directly

This commit is contained in:
hugovk 2017-11-16 18:27:07 +02:00 committed by wiredfool
parent 96df8a8fda
commit a3286391c3
2 changed files with 1 additions and 32 deletions

View File

@ -89,7 +89,7 @@ sdist:
python setup.py sdist --format=gztar python setup.py sdist --format=gztar
test: test:
python test-installed.py pytest -qq
# https://docs.python.org/2/distutils/packageindex.html#the-pypirc-file # https://docs.python.org/2/distutils/packageindex.html#the-pypirc-file
upload-test: upload-test:

View File

@ -1,31 +0,0 @@
#!/usr/bin/env python
import os
import sys
import pytest
# monkey with the path, removing the local directory but adding the Tests/
# directory for helper.py and the other local imports there.
del(sys.path[0])
sys.path.insert(0, os.path.abspath('./Tests'))
# if there's no test selected (mostly) choose a working default.
# 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:]):
if arg.startswith('Tests/test_') and arg.endswith('.py'):
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
if __name__ == '__main__':
pytest.main()