Skip to content

Commit

Permalink
TST: Fix matplotlib import test
Browse files Browse the repository at this point in the history
  • Loading branch information
mferrera committed Dec 6, 2023
1 parent d7a60e6 commit 0dd4d6f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/test_plot/test_matplotlib_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from unittest import mock

import pytest
from packaging.version import parse as versionparse


def _clear_state(sys, os):
Expand Down Expand Up @@ -36,7 +37,13 @@ def test_that_mpl_dynamically_imports():
baseplot = BasePlot()

assert "matplotlib" in sys.modules
assert "matplotlib.pyplot" not in sys.modules

import matplotlib as mpl

if versionparse(mpl.__version__) < versionparse("3.6"):
assert "matplotlib.pyplot" in sys.modules
else:
assert "matplotlib.pyplot" not in sys.modules

baseplot.close()

Expand Down

0 comments on commit 0dd4d6f

Please sign in to comment.