Skip to content

Commit 1d92f3d

Browse files
committed
Check that the plugin doesn't stop pytest from running if Matplotlib isn't installed
1 parent c3974b3 commit 1d92f3d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ env:
2020
- PYTHON_VERSION=3.6 TOXENV=py36-test-mpl22
2121
- PYTHON_VERSION=3.7 TOXENV=py37-test-mpl30
2222
- PYTHON_VERSION=3.8 TOXENV=py38-test-mpl31
23+
- PYTHON_VERSION=3.8 TOXENV=py38-test-minimal
2324
- PYTHON_VERSION=3.8 TOXENV=codestyle
2425

2526
install:

tox.ini

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ deps =
1818
mpl31: matplotlib==3.1.*
1919
mpldev: git+https://github.com/matplotlib/matplotlib.git#egg=matplotlib
2020
extras =
21-
test
21+
!minimal: test
2222
commands =
2323
pip freeze
2424
# Make sure the tests pass with and without --mpl
25-
pytest {toxinidir}/tests --cov pytest_mpl --cov-config={toxinidir}/setup.cfg {posargs}
26-
pytest {toxinidir}/tests --mpl --cov pytest_mpl --cov-config={toxinidir}/setup.cfg {posargs}
25+
!minimal: pytest {toxinidir}/tests --cov pytest_mpl --cov-config={toxinidir}/setup.cfg {posargs}
26+
!minimal: pytest {toxinidir}/tests --mpl --cov pytest_mpl --cov-config={toxinidir}/setup.cfg {posargs}
27+
# Make sure that the plugin won't crash pytest if Matplotlib isn't installed
28+
minimal: python -c 'import pytest_mpl.plugin'
2729

2830
[testenv:codestyle]
2931
skip_install = true

0 commit comments

Comments
 (0)