Skip to content

Commit 94ba70b

Browse files
committed
Improve help docs for the "--variables" option
1 parent 05416e0 commit 94ba70b

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

seleniumbase/plugins/base_plugin.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,16 @@ def options(self, parser, env):
9292
"--variables",
9393
dest="variables",
9494
default=None,
95-
help="A var dict to pass to tests from the command line.",
95+
help="""A var dict to pass to tests from the command line.
96+
Example usage:
97+
----------------------------------------------
98+
Option: --variables='{"special":123}'
99+
Access: self.variables["special"]
100+
----------------------------------------------
101+
Option: --variables='{"color":"red","num":42}'
102+
Access: self.variables["color"]
103+
Access: self.variables["num"]
104+
----------------------------------------------""",
96105
)
97106
parser.add_option(
98107
"--settings_file",

seleniumbase/plugins/pytest_plugin.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,16 @@ def pytest_addoption(parser):
230230
"--variables",
231231
dest="variables",
232232
default=None,
233-
help="A var dict to pass to tests from the command line.",
233+
help="""A var dict to pass to tests from the command line.
234+
Example usage:
235+
----------------------------------------------
236+
Option: --variables='{"special":123}'
237+
Access: self.variables["special"] # (123)
238+
----------------------------------------------
239+
Option: --variables='{"color":"red","num":42}'
240+
Access: self.variables["color"] # ("red")
241+
Access: self.variables["num"] # (42)
242+
----------------------------------------------""",
234243
)
235244
parser.addoption(
236245
"--cap_file",

0 commit comments

Comments
 (0)