Skip to content

Commit

Permalink
extend docs and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OriolAbril committed Jul 6, 2024
1 parent 09d1121 commit 56b403a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/source/contributing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ but backend specific tests can be skipped when running the test suite:
```console
tox -e py311 -- --skip-bokeh
tox -e py311 -- --skip-mpl
tox -e py311 -- --skip-plotly
```

:::{note} It is also possible to use both flags, in which case, only tests
Expand Down
Binary file added docs/source/gallery/_images/plot_forest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/gallery/_images/plot_trace_dist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def pytest_addoption(parser):
parser.addoption("--save", nargs="?", const="test_images", help="Save images rendered by plot")
parser.addoption("--skip-mpl", action="store_const", const=True, help="Skip matplotlib tests")
parser.addoption("--skip-bokeh", action="store_const", const=True, help="Skip bokeh tests")
parser.addoption("--skip-plotly", action="store_const", const=True, help="Skip plotly tests")


@pytest.fixture(scope="session")
Expand Down Expand Up @@ -68,12 +69,15 @@ def check_skips(request):
"""Skip bokeh or matplotlib tests if requested via command line."""
skip_mpl = request.config.getoption("--skip-mpl")
skip_bokeh = request.config.getoption("--skip-bokeh")
skip_plotly = request.config.getoption("--skip-plotly")

if "backend" in request.fixturenames:
if skip_mpl and any("matplotlib" in key for key in request.keywords.keys()):
pytest.skip(reason="Requested skipping matplolib tests via command line argument")
if skip_bokeh and any("bokeh" in key for key in request.keywords.keys()):
pytest.skip(reason="Requested skipping bokeh tests via command line argument")
if skip_plotly and any("plotly" in key for key in request.keywords.keys()):
pytest.skip(reason="Requested skipping plotly tests via command line argument")


@pytest.fixture(scope="function")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_plot_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def dataset(seed=31):
)


@pytest.mark.parametrize("backend", ["matplotlib", "bokeh"])
@pytest.mark.parametrize("backend", ["matplotlib", "bokeh", "plotly"])
@pytest.mark.usefixtures("clean_plots")
@pytest.mark.usefixtures("check_skips")
class TestFacetting:
Expand Down

0 comments on commit 56b403a

Please sign in to comment.