Fix issue with "pytest -h"

This commit is contained in:
Michael Mintz 2025-02-24 16:07:22 -05:00
parent 4b249b8bde
commit b8d308d3b4
1 changed files with 3 additions and 0 deletions

View File

@ -2496,6 +2496,9 @@ def pytest_unconfigure(config):
"""This runs after all tests have completed with pytest."""
if "--co" in sys_argv or "--collect-only" in sys_argv:
return
reporter = config.pluginmanager.get_plugin("terminalreporter")
if not hasattr(reporter, "_sessionstarttime"):
return
if hasattr(sb_config, "_multithreaded") and sb_config._multithreaded:
import fasteners