File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -533,9 +533,11 @@ def dump_stacks(terminal):
533
533
534
534
535
535
def pytest_runtest_makereport (item , call ):
536
- session = item .session
537
- config = session .config
538
- expire_time = config .stash [SUITE_TIMEOUT_KEY ]
539
- if expire_time and (expire_time < time .time ()):
540
- timeout = config .getoption ("--suite-timeout" )
541
- session .shouldfail = f"suite-timeout: { timeout } sec exceeded"
536
+ # only need to check timeout once, at the end, after teardown
537
+ if call .when == "teardown" :
538
+ session = item .session
539
+ config = session .config
540
+ expire_time = config .stash [SUITE_TIMEOUT_KEY ]
541
+ if expire_time and (expire_time < time .time ()):
542
+ timeout = config .getoption ("--suite-timeout" )
543
+ session .shouldfail = f"suite-timeout: { timeout } sec exceeded"
You can’t perform that action at this time.
0 commit comments