forked from matplotlib/matplotlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
executable file
·49 lines (38 loc) · 1.54 KB
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python
#
# This allows running the matplotlib tests from the command line: e.g.
#
# $ python tests.py -v -d
#
# The arguments are identical to the arguments accepted by pytest.
#
# See http://doc.pytest.org/ for a detailed description of these options.
import sys
import argparse
if __name__ == '__main__':
import dateutil.parser
try:
import setuptools
except ImportError:
pass
# The warnings need to be before any of matplotlib imports, but after
# dateutil.parser and setuptools (if present) which has syntax error with
# the warnings enabled. Filtering by module does not work as this will be
# raised by Python itself so `module=matplotlib.*` is out of question.
import warnings
# Python 3.6 deprecate invalid character-pairs \A, \* ... in non
# raw-strings and other things. Let's not re-introduce them
warnings.filterwarnings('error', '.*invalid escape sequence.*',
category=DeprecationWarning)
warnings.filterwarnings(
'default',
r'.*inspect.getargspec\(\) is deprecated.*',
category=DeprecationWarning)
from matplotlib import test
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument('--recursionlimit', type=int, default=0,
help='Specify recursionlimit for test run')
args, extra_args = parser.parse_known_args()
print('Python byte-compilation optimization level:', sys.flags.optimize)
retcode = test(argv=extra_args, recursionlimit=args.recursionlimit)
sys.exit(retcode)