fix(tests): ensure the client is open when stopping screen recording

[no changelog]
pull/2762/head
matejcik 1 year ago committed by matejcik
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…
Cancel
Save