Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b1797b

Browse files
committed
Fix assertion error
import must be local
1 parent 6af9062 commit 6b1797b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/matplotlib/tests/test_backends_interactive.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import matplotlib as mpl
2020
from matplotlib import _c_internal_utils
21-
from matplotlib.backend_bases import FigureCanvasBase
2221
from matplotlib.backend_tools import ToolToggleBase
2322
from matplotlib.testing import subprocess_run_helper as _run_helper, is_ci_environment
2423

@@ -163,7 +162,7 @@ def _test_interactive_impl():
163162

164163
import matplotlib as mpl
165164
from matplotlib import pyplot as plt
166-
from matplotlib.backend_bases import KeyEvent
165+
from matplotlib.backend_bases import KeyEvent, FigureCanvasBase
167166
mpl.rcParams.update({
168167
"webagg.open_in_browser": False,
169168
"webagg.port_retries": 1,
@@ -230,7 +229,7 @@ def check_alt_backend(alt_backend):
230229

231230
# When the figure is closed, it's manager is removed and the canvas is reset to
232231
# FigureCanvasBase. Saving should still be possible.
233-
assert type(fig.canvas) == FigureCanvasBase
232+
assert type(fig.canvas) == FigureCanvasBase, str(fig.canvas)
234233
result_after = io.BytesIO()
235234
fig.savefig(result_after, format='png', dpi=100)
236235

0 commit comments

Comments
 (0)