Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore accidentally removed pytest.ini and tests.py.
- Loading branch information
Showing
2 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
[pytest] | ||
# NOTE: Because tests can be run from an installed copy, most of our Pytest | ||
# Because tests can be run from an installed copy, most of our Pytest | ||
# configuration is in the `pytest_configure` function in | ||
# `lib/matplotlib/testing/conftest.py`. This configuration file exists only to | ||
# prevent Pytest from wasting time trying to check examples and documentation | ||
# files that are not really tests. | ||
# set a minimum pytest version and to prevent pytest from wasting time trying | ||
# to check examples and documentation files that are not really tests. | ||
|
||
[pytest] | ||
minversion = 3.6 | ||
|
||
testpaths = lib | ||
python_files = test_*.py | ||
junit_family = xunit2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/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__': | ||
try: | ||
from matplotlib import test | ||
except ImportError: | ||
print('matplotlib.test could not be imported.\n\n' | ||
'Try a virtual env and `pip install -e .`') | ||
sys.exit(-1) | ||
|
||
parser = argparse.ArgumentParser(add_help=False) | ||
parser.add_argument('--recursionlimit', type=int, default=None, | ||
help='Specify recursionlimit for test run') | ||
args, extra_args = parser.parse_known_args() | ||
|
||
print('Python byte-compilation optimization level:', sys.flags.optimize) | ||
|
||
if args.recursionlimit is not None: # Will trigger deprecation. | ||
retcode = test(argv=extra_args, recursionlimit=args.recursionlimit) | ||
else: | ||
retcode = test(argv=extra_args) | ||
sys.exit(retcode) |