Skip to content

Commit 8836561

Browse files
committed
add comment
1 parent 0492926 commit 8836561

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

test/functional/android/bidi_tests.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def from_json(cls, json: dict):
4848

4949

5050
class TestChromeWithBiDi:
51+
"""This test requires selenium python client which supports 'command_builder'"""
52+
5153
def setup_method(self) -> None:
5254
client_config = AppiumClientConfig(remote_server_addr=SERVER_URL_BASE)
5355
client_config.timeout = 600
@@ -70,8 +72,10 @@ def _log(entry: AppiumLogEntry):
7072
# e.g. {'type': 'syslog', 'level': 'info', 'source': {'realm': ''}, 'text': '08-05 13:30:32.617 29677 29709 I appium : channel read: GET /session/d7c38859-8930-4eb0-960a-8f917c9e6a38/source', 'timestamp': 1754368241565}
7173
log_entries.append(entry.json)
7274

73-
callback_id = self.driver.script.conn.add_callback(AppiumLogEntry, _log)
74-
self.driver.page_source
75-
assert len(log_entries) != 0
76-
self.driver.script.conn.remove_callback(AppiumLogEntry, callback_id)
77-
self.driver.script.conn.execute(command_builder('session.unsubscribe', bidi_log_param))
75+
try:
76+
callback_id = self.driver.script.conn.add_callback(AppiumLogEntry, _log)
77+
self.driver.page_source
78+
assert len(log_entries) != 0
79+
self.driver.script.conn.remove_callback(AppiumLogEntry, callback_id)
80+
finally:
81+
self.driver.script.conn.execute(command_builder('session.unsubscribe', bidi_log_param))

0 commit comments

Comments
 (0)