mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-08 22:40:59 +00:00
fix(tests): ensure the client is open when stopping screen recording
[no changelog]
This commit is contained in:
parent
9748a56a55
commit
508b6a87e6
@ -618,6 +618,11 @@ class TrezorClientDebugLink(TrezorClient):
|
||||
Callable[[protobuf.MessageType], protobuf.MessageType],
|
||||
] = {}
|
||||
|
||||
def ensure_open(self) -> None:
|
||||
"""Only open session if there isn't already an open one."""
|
||||
if self.session_counter == 0:
|
||||
self.open()
|
||||
|
||||
def open(self) -> None:
|
||||
super().open()
|
||||
if self.session_counter == 1:
|
||||
|
@ -153,6 +153,7 @@ def screen_recording(
|
||||
client.debug.start_recording(str(screen_path))
|
||||
yield
|
||||
finally:
|
||||
client.ensure_open()
|
||||
# Wait for response to Initialize, which gives the emulator time to catch up
|
||||
# and redraw the homescreen. Otherwise there's a race condition between that
|
||||
# and stopping recording.
|
||||
|
Loading…
Reference in New Issue
Block a user