X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ env:
- PANDAS=
- NPROC=2
- TEST_ARGS=--no-pep8
- NOSE_ARGS="--processes=$NPROC --process-timeout=300"
- NOSE_ARGS="-j $NPROC"
- PYTEST_ARGS="-ra --timeout=300 --durations=25 --cov-report= --cov=lib" # -n $NPROC
- PYTHON_ARGS=
- DELETE_FONT_CACHE=
Expand Down
25 changes: 21 additions & 4 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,41 @@
# these options.

import sys
import argparse


if __name__ == '__main__':
from matplotlib import default_test_modules, test

extra_args = []
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument('--no-pep8', action='store_true',
help='Run all tests except PEP8 testing')
parser.add_argument('--pep8', action='store_true',
help='Run only PEP8 testing')
parser.add_argument('--no-network', action='store_true',
help='Run tests without network connection')
parser.add_argument('-j', type=int,
help='Shortcut for specifying number of test processes')
args, extra_args = parser.parse_known_args()

if '--no-pep8' in sys.argv:
if args.no_pep8:
default_test_modules.remove('matplotlib.tests.test_coding_standards')
sys.argv.remove('--no-pep8')
elif '--pep8' in sys.argv:
elif args.pep8:
default_test_modules[:] = ['matplotlib.tests.test_coding_standards']
sys.argv.remove('--pep8')
if '--no-network' in sys.argv:
if args.no_network:
from matplotlib.testing import disable_internet
disable_internet.turn_off_internet()
extra_args.extend(['-a', '!network'])
sys.argv.remove('--no-network')
if args.j:
extra_args.extend([
'--processes={}'.format(args.j),
'--process-timeout=300'
])
sys.argv.pop(sys.argv.index('-j') + 1)
sys.argv.remove('-j')

print('Python byte-compilation optimization level: %d' % sys.flags.optimize)

Expand Down
X Tutup