Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ef46679

Browse filesBrowse files
committed
Restore accidentally removed pytest.ini and tests.py.
1 parent 3df958c commit ef46679
Copy full SHA for ef46679

File tree

Expand file treeCollapse file tree

2 files changed

+43
-4
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+43
-4
lines changed

‎pytest.ini

Copy file name to clipboard
+9-4Lines 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

Copy file name to clipboard
+34Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.