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

Skip to content

Commit 8d82733

Browse files
authored
Merge pull request #14667 from anntzer/pytestini
Move most of pytest's conf to conftest.py.
2 parents ce72670 + 2cd914d commit 8d82733

2 files changed

Lines changed: 16 additions & 11 deletions

File tree

lib/matplotlib/testing/conftest.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@
55

66

77
def pytest_configure(config):
8+
# config is initialized here rather than in pytest.ini so that `pytest
9+
# --pyargs matplotlib` (which would not find pytest.ini) works. The only
10+
# entries in pytest.ini set minversion (which is checked earlier) and
11+
# testpaths/python_files, as they are required to properly find the tests.
12+
for key, value in [
13+
("markers", "flaky: (Provided by pytest-rerunfailures.)"),
14+
("markers", "timeout: (Provided by pytest-timeout.)"),
15+
("markers", "backend: Set alternate Matplotlib backend temporarily."),
16+
("markers", "style: Set alternate Matplotlib style temporarily."),
17+
("markers", "baseline_images: Compare output against references."),
18+
("markers", "pytz: Tests that require pytz to be installed."),
19+
("filterwarnings", "error"),
20+
]:
21+
config.addinivalue_line(key, value)
22+
823
matplotlib.use('agg', force=True)
924
matplotlib._called_from_pytest = True
1025
matplotlib._init_tests()

pytest.ini

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1+
# Additional configuration is in matplotlib/testing/conftest.py.
12
[pytest]
23
minversion = 3.6
34

45
testpaths = lib
56
python_files = test_*.py
6-
7-
markers =
8-
flaky: (Provided by pytest-rerunfailures.)
9-
timeout: (Provided by pytest-timeout.)
10-
backend: Set alternate Matplotlib backend temporarily.
11-
style: Set alternate Matplotlib style temporarily.
12-
baseline_images: Compare output against a known reference.
13-
pytz: Tests that require pytz to be installed.
14-
15-
filterwarnings =
16-
error

0 commit comments

Comments
 (0)