mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-03-12 14:16:06 +00:00
chore(tests): adapt testing framework to session based
[no changelog]
This commit is contained in:
parent
a028570bd1
commit
bdf0cbbdb5
@ -22,6 +22,7 @@ from enum import IntEnum
|
||||
from pathlib import Path
|
||||
from time import sleep
|
||||
|
||||
import cryptography
|
||||
import pytest
|
||||
import xdist
|
||||
from _pytest.python import IdMaker
|
||||
@ -303,12 +304,17 @@ def _client_unlocked(
|
||||
should_format = sd_marker.kwargs.get("formatted", True)
|
||||
_raw_client.debug.erase_sd_card(format=should_format)
|
||||
|
||||
while True:
|
||||
try:
|
||||
if _raw_client.is_invalidated:
|
||||
_raw_client = _raw_client.get_new_client()
|
||||
session = _raw_client.get_seedless_session()
|
||||
wipe_device(session)
|
||||
sleep(1.5) # Makes tests more stable (wait for wipe to finish)
|
||||
|
||||
break
|
||||
except cryptography.exceptions.InvalidTag:
|
||||
# Get a new client
|
||||
_raw_client = _get_raw_client(request)
|
||||
if not _raw_client.features.bootloader_mode:
|
||||
_raw_client.refresh_features()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user