@@ -19,27 +19,28 @@ def test_signal_blocker_exception(qtbot):
19
19
qtbot .waitSignal (None , None ).wait ()
20
20
21
21
22
- def explicit_wait (qtbot , signal , timeout , multiple , raising , raises ):
22
+ def explicit_wait (qtbot , signal , timeout , multiple , raising , should_raise ):
23
23
"""
24
24
Explicit wait for the signal using blocker API.
25
25
"""
26
26
func = qtbot .waitSignals if multiple else qtbot .waitSignal
27
27
blocker = func (signal , timeout , raising = raising )
28
28
assert not blocker .signal_triggered
29
- if raises :
29
+ if should_raise :
30
30
with pytest .raises (qtbot .SignalTimeoutError ):
31
31
blocker .wait ()
32
32
else :
33
33
blocker .wait ()
34
34
return blocker
35
35
36
36
37
- def context_manager_wait (qtbot , signal , timeout , multiple , raising , raises ):
37
+ def context_manager_wait (qtbot , signal , timeout , multiple , raising ,
38
+ should_raise ):
38
39
"""
39
40
Waiting for signal using context manager API.
40
41
"""
41
42
func = qtbot .waitSignals if multiple else qtbot .waitSignal
42
- if raises :
43
+ if should_raise :
43
44
with pytest .raises (qtbot .SignalTimeoutError ):
44
45
with func (signal , timeout , raising = raising ) as blocker :
45
46
pass
@@ -66,8 +67,8 @@ def context_manager_wait(qtbot, signal, timeout, multiple, raising, raises):
66
67
(context_manager_wait , 2000 , 500 , False , True ),
67
68
]
68
69
)
69
- def test_signal_triggered (qtbot , single_shot , wait_function , emit_delay , timeout ,
70
- expected_signal_triggered , raising ):
70
+ def test_signal_triggered (qtbot , single_shot , wait_function , emit_delay ,
71
+ timeout , expected_signal_triggered , raising ):
71
72
"""
72
73
Testing for a signal in different conditions, ensuring we are obtaining
73
74
the expected results.
@@ -76,10 +77,10 @@ def test_signal_triggered(qtbot, single_shot, wait_function, emit_delay, timeout
76
77
single_shot (signaller .signal , emit_delay )
77
78
78
79
start_time = time .time ()
79
- raises = raising and not expected_signal_triggered
80
+ should_raise = raising and not expected_signal_triggered
80
81
81
82
blocker = wait_function (qtbot , signaller .signal , timeout , raising = raising ,
82
- raises = raises , multiple = False )
83
+ should_raise = should_raise , multiple = False )
83
84
84
85
# Check that event loop exited.
85
86
assert not blocker ._loop .isRunning ()
@@ -114,8 +115,7 @@ def test_signal_triggered(qtbot, single_shot, wait_function, emit_delay, timeout
114
115
]
115
116
)
116
117
def test_signal_triggered_multiple (qtbot , single_shot , wait_function ,
117
- emit_delay_1 ,
118
- emit_delay_2 , timeout ,
118
+ emit_delay_1 , emit_delay_2 , timeout ,
119
119
expected_signal_triggered , raising ):
120
120
"""
121
121
Testing for a signal in different conditions, ensuring we are obtaining
@@ -125,11 +125,11 @@ def test_signal_triggered_multiple(qtbot, single_shot, wait_function,
125
125
single_shot (signaller .signal , emit_delay_1 )
126
126
single_shot (signaller .signal_2 , emit_delay_2 )
127
127
128
- raises = raising and not expected_signal_triggered
128
+ should_raise = raising and not expected_signal_triggered
129
129
start_time = time .time ()
130
130
blocker = wait_function (qtbot , [signaller .signal , signaller .signal_2 ],
131
131
timeout , multiple = True , raising = raising ,
132
- raises = raises )
132
+ should_raise = should_raise )
133
133
134
134
# Check that event loop exited.
135
135
assert not blocker ._loop .isRunning ()
@@ -177,6 +177,7 @@ def single_shot():
177
177
178
178
The fixture is responsible for cleaning up after the timers.
179
179
"""
180
+
180
181
def shoot (signal , delay ):
181
182
timer = QtCore .QTimer ()
182
183
timer .setSingleShot (True )
0 commit comments