19
19
20
20
21
21
__all__ = ("is_debugging" , "Settings" )
22
- suite_timeout_key = pytest .StashKey [float ]()
22
+ SUITE_TIMEOUT_KEY = pytest .StashKey [float ]()
23
23
24
24
25
25
HAVE_SIGALRM = hasattr (signal , "SIGALRM" )
@@ -135,13 +135,9 @@ def pytest_addhooks(pluginmanager):
135
135
pluginmanager .add_hookspecs (TimeoutHooks )
136
136
137
137
138
- _suite_expire_time = 0
139
-
140
-
141
138
@pytest .hookimpl
142
139
def pytest_configure (config ):
143
140
"""Register the marker so it shows up in --markers output."""
144
- global _suite_expire_time , _suite_timeout_minutes
145
141
config .addinivalue_line (
146
142
"markers" ,
147
143
"timeout(timeout, method=None, func_only=False, "
@@ -168,7 +164,7 @@ def pytest_configure(config):
168
164
expire_time = time .time () + timeout
169
165
else :
170
166
expire_time = 0
171
- config .stash [suite_timeout_key ] = expire_time
167
+ config .stash [SUITE_TIMEOUT_KEY ] = expire_time
172
168
173
169
174
170
@pytest .hookimpl (hookwrapper = True )
@@ -539,7 +535,7 @@ def dump_stacks(terminal):
539
535
def pytest_runtest_makereport (item , call ):
540
536
session = item .session
541
537
config = session .config
542
- expire_time = config .stash [suite_timeout_key ]
538
+ expire_time = config .stash [SUITE_TIMEOUT_KEY ]
543
539
if expire_time and (expire_time < time .time ()):
544
540
timeout = config .getoption ("--suite-timeout" )
545
541
session .shouldfail = f"suite-timeout: { timeout } sec exceeded"
0 commit comments