mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-09 22:13:43 +08:00
22a8575199
Keep official openpilot ancestry and dependency licenses. Store resources directly in Git, remove LFS setup requirements, and leave the downloadable big model outside the source tree.
14 lines
542 B
Python
14 lines
542 B
Python
import os, pytest, faulthandler
|
|
|
|
stderr_fd_key = pytest.StashKey[int]()
|
|
def pytest_configure(config):
|
|
# dup stderr so that we can still write to it in faulthandler even if stderr would be captured
|
|
config.stash[stderr_fd_key] = fd = os.dup(2)
|
|
config.add_cleanup(lambda: os.close(fd))
|
|
|
|
@pytest.hookimpl(wrapper=True)
|
|
def pytest_runtest_call(item):
|
|
faulthandler.dump_traceback_later(int(os.getenv("TEST_TIMEOUT", 120)), file=item.config.stash[stderr_fd_key], exit=True)
|
|
try: yield
|
|
finally: faulthandler.cancel_dump_traceback_later()
|