File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 8
8
import pytest
9
9
10
10
11
- @pytest .fixture (autouse = True )
11
+ def pytest_generate_tests (metafunc ):
12
+ """
13
+ Insert qt4_module fixture as *first* fixture.
14
+
15
+ It is very important that it is first, because it skips tests when Qt4 is
16
+ not available. Making it an autouse fixture, or using it as a parameter
17
+ would not leave it first. If this fixture is not first, then the
18
+ `mpl_test_settings` fixture will try to switch backends before the skip can
19
+ be triggered.
20
+ """
21
+ metafunc .fixturenames .insert (0 , 'qt4_module' )
22
+
23
+
24
+ @pytest .fixture
12
25
def qt4_module ():
13
26
try :
14
27
import PyQt4
Original file line number Diff line number Diff line change 8
8
import pytest
9
9
10
10
11
- @pytest .fixture (autouse = True )
11
+ def pytest_generate_tests (metafunc ):
12
+ """
13
+ Insert qt5_module fixture as *first* fixture.
14
+
15
+ It is very important that it is first, because it skips tests when Qt5 is
16
+ not available. Making it an autouse fixture, or using it as a parameter
17
+ would not leave it first. If this fixture is not first, then the
18
+ `mpl_test_settings` fixture will try to switch backends before the skip can
19
+ be triggered.
20
+ """
21
+ metafunc .fixturenames .insert (0 , 'qt5_module' )
22
+
23
+
24
+ @pytest .fixture
12
25
def qt5_module ():
13
26
try :
14
27
import PyQt5
You can’t perform that action at this time.
0 commit comments