pytest: fix tici setup fixture (#31379)

cleanup

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 88d0231095babbb1f572b86da060056286818da5
This commit is contained in:
Justin Newberry
2024-02-08 16:32:40 -05:00
committed by GitHub
parent 4a172b23d2
commit 1ade9aa8b2

View File

@@ -63,13 +63,12 @@ def openpilot_class_fixture():
os.environ.update(starting_env)
@pytest.fixture(scope="class")
def tici_setup_fixture():
"""Ensure a consistent state for tests on-device"""
@pytest.fixture(scope="function")
def tici_setup_fixture(openpilot_function_fixture):
"""Ensure a consistent state for tests on-device. Needs the openpilot function fixture to run first."""
HARDWARE.initialize_hardware()
HARDWARE.set_power_save(False)
os.system("pkill -9 -f athena")
os.system("rm /dev/shm/*")
@pytest.hookimpl(tryfirst=True)