File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,12 @@ def init_qt5_reactor(qapp):
147
147
)
148
148
149
149
150
+ _reactor_fixtures = {
151
+ 'default' : init_default_reactor ,
152
+ 'qt5reactor' : init_qt5_reactor ,
153
+ }
154
+
155
+
150
156
def _init_reactor ():
151
157
import twisted .internet .reactor
152
158
_instances .reactor = twisted .internet .reactor
@@ -173,15 +179,12 @@ def pytest_addoption(parser):
173
179
group .addoption (
174
180
'--reactor' ,
175
181
default = 'default' ,
176
- choices = ( 'default' , 'qt5reactor' ),
182
+ choices = tuple ( _reactor_fixtures . keys () ),
177
183
)
178
184
179
185
180
186
def pytest_configure (config ):
181
- reactor_fixture = {
182
- 'default' : init_default_reactor ,
183
- 'qt5reactor' : init_qt5_reactor ,
184
- }[config .getoption ('reactor' )]
187
+ reactor_fixture = _reactor_fixtures [config .getoption ('reactor' )]
185
188
186
189
class ReactorPlugin (object ):
187
190
reactor = staticmethod (
You can’t perform that action at this time.
0 commit comments