Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d73ba9e

Browse files
authored
Merge pull request #23153 from anntzer/t
Restore accidentally removed pytest.ini and tests.py.
2 parents a7a44b6 + ef46679 commit d73ba9e

File tree

2 files changed

+43
-4
lines changed

2 files changed

+43
-4
lines changed

pytest.ini

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
[pytest]
2-
# NOTE: Because tests can be run from an installed copy, most of our Pytest
1+
# Because tests can be run from an installed copy, most of our Pytest
32
# configuration is in the `pytest_configure` function in
43
# `lib/matplotlib/testing/conftest.py`. This configuration file exists only to
5-
# prevent Pytest from wasting time trying to check examples and documentation
6-
# files that are not really tests.
4+
# set a minimum pytest version and to prevent pytest from wasting time trying
5+
# to check examples and documentation files that are not really tests.
6+
7+
[pytest]
8+
minversion = 3.6
9+
710
testpaths = lib
11+
python_files = test_*.py
12+
junit_family = xunit2

tests.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env python
2+
#
3+
# This allows running the matplotlib tests from the command line: e.g.
4+
#
5+
# $ python tests.py -v -d
6+
#
7+
# The arguments are identical to the arguments accepted by pytest.
8+
#
9+
# See http://doc.pytest.org/ for a detailed description of these options.
10+
11+
import sys
12+
import argparse
13+
14+
15+
if __name__ == '__main__':
16+
try:
17+
from matplotlib import test
18+
except ImportError:
19+
print('matplotlib.test could not be imported.\n\n'
20+
'Try a virtual env and `pip install -e .`')
21+
sys.exit(-1)
22+
23+
parser = argparse.ArgumentParser(add_help=False)
24+
parser.add_argument('--recursionlimit', type=int, default=None,
25+
help='Specify recursionlimit for test run')
26+
args, extra_args = parser.parse_known_args()
27+
28+
print('Python byte-compilation optimization level:', sys.flags.optimize)
29+
30+
if args.recursionlimit is not None: # Will trigger deprecation.
31+
retcode = test(argv=extra_args, recursionlimit=args.recursionlimit)
32+
else:
33+
retcode = test(argv=extra_args)
34+
sys.exit(retcode)

0 commit comments

Comments
 (0)