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 8d82733

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

File tree

Expand file treeCollapse file tree

2 files changed

+16
-11
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+16
-11
lines changed

‎lib/matplotlib/testing/conftest.py

Copy file name to clipboardExpand all lines: lib/matplotlib/testing/conftest.py
+15Lines 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

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