1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-16 17:42:02 +00:00

tests/conftest: reseed before wipe

This commit is contained in:
Tomas Susanka 2020-01-07 11:34:38 +00:00
parent 0c820091a8
commit 78bd43d3c4

View File

@ -90,6 +90,16 @@ def client(request):
" pytest -m 'not sd_card' <test path>"
)
test_ui = request.config.getoption("ui")
if test_ui not in ("", "record", "test"):
raise ValueError("Invalid ui option.")
run_ui_tests = not request.node.get_closest_marker("skip_ui") and test_ui
client.open()
if run_ui_tests:
# we need to reseed before the wipe
client.debug.reseed(0)
wipe_device(client)
setup_params = dict(
@ -126,15 +136,7 @@ def client(request):
# ClearSession locks the device. We only do that if the PIN is set.
client.clear_session()
client.open()
test_ui = request.config.getoption("ui")
if test_ui not in ("", "record", "test"):
raise ValueError("Invalid ui option.")
run_ui_tests = not request.node.get_closest_marker("skip_ui") and test_ui
if run_ui_tests:
client.debug.reseed(0)
with ui_tests.screen_recording(client, request):
yield client
else: