Skip to content

Commit 67285c4

Browse files
committed
CI: Update 'pytest.importorskip' usage
1 parent d76a59b commit 67285c4

35 files changed

+107
-38
lines changed

qtpy/tests/test_main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import pytest
77

88
from qtpy import API_NAMES, QtCore, QtGui, QtWidgets
9+
from qtpy.tests.utils import pytest_importorskip
910

1011
with contextlib.suppress(Exception):
1112
# removed in qt 6.0
@@ -112,7 +113,7 @@ def test_qt_api_environ(api):
112113
If no QT_API is specified but some Qt is imported, ensure QT_API is set properly.
113114
"""
114115
mod = f"{api}.QtCore"
115-
pytest.importorskip(mod, reason=f"Requires {api}")
116+
pytest_importorskip(mod, reason=f"Requires {api}")
116117
# clean env
117118
env = os.environ.copy()
118119
for key in ("QT_API", "USE_QT_API"):

qtpy/tests/test_qsci.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pytest
44

55
from qtpy import PYSIDE2, PYSIDE6
6-
from qtpy.tests.utils import using_conda
6+
from qtpy.tests.utils import pytest_importorskip, using_conda
77

88

99
@pytest.mark.skipif(
@@ -12,7 +12,7 @@
1212
)
1313
def test_qsci():
1414
"""Test the qtpy.Qsci namespace"""
15-
Qsci = pytest.importorskip("qtpy.Qsci")
15+
Qsci = pytest_importorskip("qtpy.Qsci")
1616
assert Qsci.QSCINTILLA_VERSION is not None
1717
assert Qsci.QSCINTILLA_VERSION_STR is not None
1818
assert Qsci.QsciAPIs is not None

qtpy/tests/test_qt3danimation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import pytest
22

3+
from qtpy.tests.utils import pytest_importorskip
4+
35

46
def test_qt3danimation():
57
"""Test the qtpy.Qt3DAnimation namespace"""
6-
Qt3DAnimation = pytest.importorskip("qtpy.Qt3DAnimation")
8+
Qt3DAnimation = pytest_importorskip("qtpy.Qt3DAnimation")
79

810
assert Qt3DAnimation.QAnimationController is not None
911
assert Qt3DAnimation.QAdditiveClipBlend is not None

qtpy/tests/test_qt3dcore.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import pytest
22

33
from qtpy import PYQT6, PYSIDE6
4+
from qtpy.tests.utils import pytest_importorskip
45

56

67
@pytest.mark.skipif(PYQT6, reason="Not complete in PyQt6")
78
@pytest.mark.skipif(PYSIDE6, reason="Not complete in PySide6")
89
def test_qt3dcore():
910
"""Test the qtpy.Qt3DCore namespace"""
10-
Qt3DCore = pytest.importorskip("qtpy.Qt3DCore")
11+
Qt3DCore = pytest_importorskip("qtpy.Qt3DCore")
1112

1213
assert Qt3DCore.QPropertyValueAddedChange is not None
1314
assert Qt3DCore.QSkeletonLoader is not None

qtpy/tests/test_qt3dextras.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import pytest
22

3+
from qtpy.tests.utils import pytest_importorskip
4+
35

46
def test_qt3dextras():
57
"""Test the qtpy.Qt3DExtras namespace"""
6-
Qt3DExtras = pytest.importorskip("qtpy.Qt3DExtras")
8+
Qt3DExtras = pytest_importorskip("qtpy.Qt3DExtras")
79

810
assert Qt3DExtras.QTextureMaterial is not None
911
assert Qt3DExtras.QPhongAlphaMaterial is not None

qtpy/tests/test_qt3dinput.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import pytest
22

3+
from qtpy.tests.utils import pytest_importorskip
4+
35

46
def test_qt3dinput():
57
"""Test the qtpy.Qt3DInput namespace"""
6-
Qt3DInput = pytest.importorskip("qtpy.Qt3DInput")
8+
Qt3DInput = pytest_importorskip("qtpy.Qt3DInput")
79

810
assert Qt3DInput.QAxisAccumulator is not None
911
assert Qt3DInput.QInputSettings is not None

qtpy/tests/test_qt3dlogic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import pytest
22

3+
from qtpy.tests.utils import pytest_importorskip
4+
35

46
def test_qt3dlogic():
57
"""Test the qtpy.Qt3DLogic namespace"""
6-
Qt3DLogic = pytest.importorskip("qtpy.Qt3DLogic")
8+
Qt3DLogic = pytest_importorskip("qtpy.Qt3DLogic")
79

810
assert Qt3DLogic.QLogicAspect is not None
911
assert Qt3DLogic.QFrameAction is not None

qtpy/tests/test_qt3drender.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import pytest
22

33
from qtpy import PYQT6, PYSIDE6
4+
from qtpy.tests.utils import pytest_importorskip
45

56

67
@pytest.mark.skipif(PYQT6, reason="Not complete in PyQt6")
78
@pytest.mark.skipif(PYSIDE6, reason="Not complete in PySide6")
89
def test_qt3drender():
910
"""Test the qtpy.Qt3DRender namespace"""
10-
Qt3DRender = pytest.importorskip("qtpy.Qt3DRender")
11+
Qt3DRender = pytest_importorskip("qtpy.Qt3DRender")
1112

1213
assert Qt3DRender.QPointSize is not None
1314
assert Qt3DRender.QFrustumCulling is not None

qtpy/tests/test_qtaxcontainer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import pytest
22

3+
from qtpy.tests.utils import pytest_importorskip
4+
35

46
def test_qtaxcontainer():
57
"""Test the qtpy.QtAxContainer namespace"""
6-
QtAxContainer = pytest.importorskip("qtpy.QtAxContainer")
8+
QtAxContainer = pytest_importorskip("qtpy.QtAxContainer")
79

810
assert QtAxContainer.QAxSelect is not None
911
assert QtAxContainer.QAxWidget is not None

qtpy/tests/test_qtbluetooth.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import pytest
22

3+
from qtpy.tests.utils import pytest_importorskip
4+
35

46
def test_qtbluetooth():
57
"""Test the qtpy.QtBluetooth namespace"""
6-
QtBluetooth = pytest.importorskip("qtpy.QtBluetooth")
8+
QtBluetooth = pytest_importorskip("qtpy.QtBluetooth")
79

810
assert QtBluetooth.QBluetooth is not None
911
assert QtBluetooth.QBluetoothDeviceInfo is not None

0 commit comments

Comments
 (0)