File tree 3 files changed +7
-4
lines changed
exception_handling/soft_error
3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 2
2
from os import linesep
3
3
4
4
import pytest
5
+ from _constant .interval import ULTRA_SHORT_INTERVAL
5
6
from _helper import operating_system
6
7
from _helper .random import random_thread_name , random_thread_name_but_not
7
8
from _helper .timer import ensure_all_timer_threads_are_stopped
@@ -17,7 +18,7 @@ def test_timer_stop_unknown_thread_soft_error_with_default_and_custom_thread(cap
17
18
custom_thread = random_thread_name ()
18
19
timer = ensure_all_timer_threads_are_stopped ()
19
20
timer .start ()
20
- time .sleep (0.001 )
21
+ time .sleep (ULTRA_SHORT_INTERVAL )
21
22
timer .stop (thread = custom_thread )
22
23
terminal_output , _ = capfd .readouterr ()
23
24
assert terminal_output == \
@@ -35,7 +36,7 @@ def test_timer_stop_unknown_thread_soft_error_with_multiple_custom_threads(capfd
35
36
custom_thread_2 = random_thread_name_but_not (custom_thread_1 )
36
37
timer = ensure_all_timer_threads_are_stopped ()
37
38
timer .start (thread = custom_thread_1 )
38
- time .sleep (0.001 )
39
+ time .sleep (ULTRA_SHORT_INTERVAL )
39
40
timer .stop (thread = custom_thread_2 )
40
41
terminal_output , _ = capfd .readouterr ()
41
42
assert terminal_output == \
Original file line number Diff line number Diff line change 1
1
import re
2
2
import time
3
3
4
+ from _constant .interval import ULTRA_SHORT_INTERVAL
4
5
from _helper .terminal_output import successful_output_regex
5
6
from _helper .timer import ensure_all_timer_threads_are_stopped
6
7
@@ -12,7 +13,7 @@ def test_timer_decimals_output(capfd: object) -> None:
12
13
ensure_all_timer_threads_are_stopped ()
13
14
for decimals in range (MINIMUM , MAXIMUM + 1 ):
14
15
with Timer (decimals = decimals ):
15
- time .sleep (0.001 )
16
+ time .sleep (ULTRA_SHORT_INTERVAL )
16
17
terminal_output , _ = capfd .readouterr ()
17
18
expected_output_regex = successful_output_regex (decimals = decimals )
18
19
assert re .fullmatch (expected_output_regex , terminal_output )
Original file line number Diff line number Diff line change 1
1
import re
2
2
import time
3
3
4
+ from _constant .interval import ULTRA_SHORT_INTERVAL
4
5
from _helper .random import random_thread_name
5
6
from _helper .terminal_output import successful_output_regex
6
7
from _helper .timer import ensure_all_timer_threads_are_stopped
@@ -12,7 +13,7 @@ def test_timer_thread_output(capfd: object) -> None:
12
13
ensure_all_timer_threads_are_stopped ()
13
14
custom_thread = random_thread_name ()
14
15
with Timer (thread = custom_thread ):
15
- time .sleep (0.001 )
16
+ time .sleep (ULTRA_SHORT_INTERVAL )
16
17
terminal_output , _ = capfd .readouterr ()
17
18
expected_output_regex = successful_output_regex (thread = custom_thread )
18
19
assert re .fullmatch (expected_output_regex , terminal_output )
You can’t perform that action at this time.
0 commit comments