Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eb17273

Browse filesBrowse files
authored
Merge pull request #28195 from QuLogic/pytest9
TST: Prepare for pytest 9
2 parents 3ee509d + 182bc0b commit eb17273
Copy full SHA for eb17273

File tree

3 files changed

+4
-9
lines changed
Filter options

3 files changed

+4
-9
lines changed

‎lib/matplotlib/tests/test_backend_bases.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_backend_bases.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import importlib
2+
13
from matplotlib import path, transforms
24
from matplotlib.backend_bases import (
35
FigureCanvasBase, KeyEvent, LocationEvent, MouseButton, MouseEvent,
@@ -325,9 +327,7 @@ def test_toolbar_home_restores_autoscale():
325327
def test_draw(backend):
326328
from matplotlib.figure import Figure
327329
from matplotlib.backends.backend_agg import FigureCanvas
328-
test_backend = pytest.importorskip(
329-
f'matplotlib.backends.backend_{backend}'
330-
)
330+
test_backend = importlib.import_module(f'matplotlib.backends.backend_{backend}')
331331
TestCanvas = test_backend.FigureCanvas
332332
fig_test = Figure(constrained_layout=True)
333333
TestCanvas(fig_test)

‎lib/matplotlib/tests/test_backend_gtk3.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_backend_gtk3.py
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
import pytest
44

55

6-
pytest.importorskip("matplotlib.backends.backend_gtk3agg")
7-
8-
96
@pytest.mark.backend("gtk3agg", skip_on_importerror=True)
107
def test_correct_key():
118
pytest.xfail("test_widget_send_event is not triggering key_press_event")

‎lib/matplotlib/tests/test_backend_qt.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_backend_qt.py
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626

2727
@pytest.fixture
2828
def qt_core(request):
29-
qt_compat = pytest.importorskip('matplotlib.backends.qt_compat')
30-
QtCore = qt_compat.QtCore
31-
29+
from matplotlib.backends.qt_compat import QtCore
3230
return QtCore
3331

3432

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.