1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
"""These tests should only be run in an environment without matplotlib installed."""
import pytest
@pytest.mark.parametrize(
"test_app",
[{"buildername": "html", "srcdir": "doc_test/doc_needbar"}],
indirect=True,
)
def test_needbar(test_app):
"""Test the build fails correctly, if matplotlib is not installed."""
test_app.build()
expected = "WARNING: Matplotlib is not installed and required by needbar. Install with `sphinx-needs[plotting]` to use. [needs.mpl]"
assert expected in test_app._warning.getvalue()
@pytest.mark.parametrize(
"test_app",
[{"buildername": "html", "srcdir": "doc_test/doc_needpie"}],
indirect=True,
)
def test_needpie(test_app):
"""Test the build fails correctly, if matplotlib is not installed."""
test_app.build()
expected = "WARNING: Matplotlib is not installed and required by needpie. Install with `sphinx-needs[plotting]` to use. [needs.mpl]"
assert expected in test_app._warning.getvalue()
|