mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-27 15:51:02 +00:00
tests: error-out sd_card tests without SD card
This commit is contained in:
parent
0f34b50c05
commit
d9efd92c0a
@ -77,6 +77,16 @@ def client(request):
|
|||||||
if request.node.get_closest_marker("skip_t1") and client.features.model == "1":
|
if request.node.get_closest_marker("skip_t1") and client.features.model == "1":
|
||||||
pytest.skip("Test excluded on Trezor 1")
|
pytest.skip("Test excluded on Trezor 1")
|
||||||
|
|
||||||
|
if (
|
||||||
|
request.node.get_closest_marker("sd_card")
|
||||||
|
and not client.features.sd_card_present
|
||||||
|
):
|
||||||
|
raise RuntimeError(
|
||||||
|
"This test requires SD card.\n"
|
||||||
|
"To skip all such tests, run:\n"
|
||||||
|
" pytest -m 'not sd_card' <test path>"
|
||||||
|
)
|
||||||
|
|
||||||
wipe_device(client)
|
wipe_device(client)
|
||||||
|
|
||||||
# fmt: off
|
# fmt: off
|
||||||
@ -141,7 +151,7 @@ def pytest_runtest_setup(item):
|
|||||||
both T1 and TT.
|
both T1 and TT.
|
||||||
"""
|
"""
|
||||||
if item.get_closest_marker("skip_t1") and item.get_closest_marker("skip_t2"):
|
if item.get_closest_marker("skip_t1") and item.get_closest_marker("skip_t2"):
|
||||||
pytest.fail("Don't skip tests for both trezors!")
|
raise RuntimeError("Don't skip tests for both trezors!")
|
||||||
|
|
||||||
skip_altcoins = int(os.environ.get("TREZOR_PYTEST_SKIP_ALTCOINS", 0))
|
skip_altcoins = int(os.environ.get("TREZOR_PYTEST_SKIP_ALTCOINS", 0))
|
||||||
if item.get_closest_marker("altcoin") and skip_altcoins:
|
if item.get_closest_marker("altcoin") and skip_altcoins:
|
||||||
|
Loading…
Reference in New Issue
Block a user