1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00

tests: shut down test suite if no device is available

this seems better than erroring out dozens of tests
This commit is contained in:
matejcik 2020-02-10 13:42:57 +01:00
parent f7608f55ff
commit 41aa818c4c

View File

@ -36,7 +36,7 @@ def get_device():
transport = get_transport(path)
return TrezorClientDebugLink(transport, auto_interact=not interact)
except Exception as e:
raise RuntimeError("Failed to open debuglink for {}".format(path)) from e
pytest.exit("Failed to open debuglink for {}".format(path), 3)
else:
devices = enumerate_devices()
@ -46,7 +46,7 @@ def get_device():
except Exception:
pass
else:
raise RuntimeError("No debuggable device found")
pytest.exit("No debuggable device found", 3)
@pytest.fixture(scope="function")