Skip to content

Commit a52ae9f

Browse files
committed
More fine grained test skips
1 parent dfd65fd commit a52ae9f

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

qtpy/tests/test_qtstatemachine.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
import pytest
22

3-
from qtpy import QtBindingInNewerVersionError
3+
from qtpy import PYQT6, PYQT_VERSION, PYSIDE6
4+
from qtpy.tests.utils import using_conda
45

56

7+
@pytest.mark.skipif(
8+
PYQT6 and int(PYQT_VERSION.split(".")[1]) < 9,
9+
reason="QtStateMachine has been added to PyQt6 in version 6.9",
10+
)
11+
@pytest.mark.skipif(
12+
PYSIDE6 and using_conda(),
13+
reason="Not available on PySide6 with conda",
14+
)
615
def test_qtstatemachine():
716
"""Test the qtpy.QtStateMachine namespace"""
8-
try:
9-
from qtpy import QtStateMachine
10-
except QtBindingInNewerVersionError:
11-
pytest.skip("QtStateMachine not available in this binding version")
17+
from qtpy import QtStateMachine
1218

1319
assert QtStateMachine.QAbstractState is not None
1420
assert QtStateMachine.QAbstractTransition is not None

0 commit comments

Comments
 (0)