Skip to content

Commit ac9f79f

Browse files
committed
Refactor a few docstrings
1 parent 5e70b91 commit ac9f79f

File tree

3 files changed

+9
-18
lines changed

3 files changed

+9
-18
lines changed

seleniumbase/common/decorators.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ def my_method():
2424
2525
with decorators.print_runtime("My Code Block"):
2626
# code ...
27-
# code ...
28-
"""
27+
# code ... """
2928
if not description:
3029
description = "Code Block"
3130
description = str(description)
@@ -68,8 +67,7 @@ def my_method():
6867

6968
@contextmanager
7069
def runtime_limit(limit, description=None):
71-
"""
72-
Fail if the runtime duration of a method or "with"-block exceeds the limit.
70+
"""Fail if the runtime duration of a method or "with"-block exceeds limit.
7371
(The failure won't occur until after the method or "with"-block completes.)
7472
7573
Method / Function example usage ->
@@ -85,8 +83,7 @@ def my_method():
8583
8684
with decorators.runtime_limit(32):
8785
# code ...
88-
# code ...
89-
"""
86+
# code ... """
9087
limit = float("%.2f" % limit)
9188
if limit < 0.01:
9289
limit = 0.01 # Minimum runtime limit
@@ -115,14 +112,12 @@ def my_method():
115112

116113

117114
def retry_on_exception(tries=6, delay=1, backoff=2, max_delay=32):
118-
"""
119-
Decorator for implementing exponential backoff for retrying on failures.
115+
"""Decorator for implementing exponential backoff for retrying on failures.
120116
121117
tries: Max number of tries to execute the wrapped function before failing.
122118
delay: Delay time in seconds before the FIRST retry.
123119
backoff: Multiplier to extend the initial delay by for each retry.
124-
max_delay: Max time in seconds to wait between retries.
125-
"""
120+
max_delay: Max time in seconds to wait between retries."""
126121
tries = math.floor(tries)
127122
if tries < 1:
128123
raise ValueError('"tries" must be greater than or equal to 1.')

seleniumbase/core/detect_b_ver.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
"""
2-
Detect the browser version before launching tests.
3-
Eg. detect_b_ver.get_browser_version_from_os("google-chrome")
4-
"""
1+
"""Detect the browser version before launching tests.
2+
Eg. detect_b_ver.get_browser_version_from_os("google-chrome")"""
53
import datetime
64
import os
75
import platform

seleniumbase/utilities/selenium_ide/convert_ide.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
Converts a Selenium IDE recording that was exported as a Python WebDriver
1+
"""Converts a Selenium IDE recording that was exported as a Python WebDriver
32
unittest file into SeleniumBase Python file.
43
Works with Katalon Recorder scripts: http://www.katalon.com/automation-recorder
54
@@ -11,8 +10,7 @@
1110
(when run from the "selenium_ide/" folder)
1211
Output:
1312
[NEW_FILE_SB].py (adds "_SB" to the original file name)
14-
(the original file is kept intact)
15-
"""
13+
(the original file is kept intact)"""
1614
import codecs
1715
import re
1816
import sys

0 commit comments

Comments
 (0)