forked from nilearn/nilearn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REF] refactor test surface plotting (nilearn#4966)
- Loading branch information
Showing
2 changed files
with
255 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import pytest | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def pyplot(): | ||
"""Set up and teardown fixture for matplotlib. | ||
This fixture checks if we can import matplotlib. If not, the tests will be | ||
skipped. Otherwise, we close the figures before and after running the | ||
functions. | ||
Returns | ||
------- | ||
pyplot : module | ||
The ``matplotlib.pyplot`` module. | ||
""" | ||
pyplot = pytest.importorskip("matplotlib.pyplot") | ||
pyplot.close("all") | ||
yield pyplot | ||
pyplot.close("all") | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def plotly(): | ||
"""Check if we can import plotly. | ||
If not, the tests will be skipped. | ||
Returns | ||
------- | ||
plotly : module | ||
The ``plotly`` module. | ||
""" | ||
plotly = pytest.importorskip("plotly") | ||
yield plotly |
Oops, something went wrong.