Skip to content

Commit 09e296c

Browse files
authored
Cleanup docstrings, fix broken formatting (#10838)
1 parent a6b161a commit 09e296c

File tree

1 file changed

+7
-8
lines changed
  • py/selenium/webdriver/common

1 file changed

+7
-8
lines changed

py/selenium/webdriver/common/log.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@ def __init__(self, driver, bidi_session) -> None:
5252
@asynccontextmanager
5353
async def mutation_events(self) -> dict:
5454
"""
55-
Listens for mutation events and emits them as it finds them
55+
Listen for mutation events and emit them as they are found.
5656
5757
:Usage:
5858
::
59+
5960
async with driver.log.mutation_events() as event:
6061
pages.load("dynamic.html")
6162
driver.find_element(By.ID, "reveal").click()
@@ -65,7 +66,6 @@ async def mutation_events(self) -> dict:
6566
assert event["attribute_name"] == "style"
6667
assert event["current_value"] == ""
6768
assert event["old_value"] == "display:none;"
68-
6969
"""
7070

7171
page = self.cdp.get_session_context('page.enable')
@@ -93,7 +93,7 @@ async def mutation_events(self) -> dict:
9393
@asynccontextmanager
9494
async def add_js_error_listener(self):
9595
"""
96-
Listens for JS errors and when the contextmanager exits check if there were JS Errors
96+
Listen for JS errors and when the contextmanager exits check if there were JS Errors.
9797
9898
:Usage:
9999
::
@@ -116,20 +116,19 @@ async def add_js_error_listener(self):
116116

117117
@asynccontextmanager
118118
async def add_listener(self, event_type) -> dict:
119-
'''
120-
Listens for certain events that are passed in.
119+
"""
120+
Listen for certain events that are passed in.
121121
122122
:Args:
123123
- event_type: The type of event that we want to look at.
124124
125-
:Usage:
125+
:Usage:
126126
::
127127
128128
async with driver.log.add_listener(Console.log) as messages:
129129
driver.execute_script("console.log('I like cheese')")
130130
assert messages["message"] == "I love cheese"
131-
132-
'''
131+
"""
133132

134133
from selenium.webdriver.common.bidi.console import Console
135134
session = self.cdp.get_session_context('page.enable')

0 commit comments

Comments
 (0)