Skip to content

Commit

Permalink
Improve help docs for the "--variables" option
Browse files Browse the repository at this point in the history
  • Loading branch information
mdmintz committed Jun 30, 2022
1 parent 05416e0 commit 94ba70b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion seleniumbase/plugins/base_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,16 @@ def options(self, parser, env):
"--variables",
dest="variables",
default=None,
help="A var dict to pass to tests from the command line.",
help="""A var dict to pass to tests from the command line.
Example usage:
----------------------------------------------
Option: --variables='{"special":123}'
Access: self.variables["special"]
----------------------------------------------
Option: --variables='{"color":"red","num":42}'
Access: self.variables["color"]
Access: self.variables["num"]
----------------------------------------------""",
)
parser.add_option(
"--settings_file",
Expand Down
11 changes: 10 additions & 1 deletion seleniumbase/plugins/pytest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,16 @@ def pytest_addoption(parser):
"--variables",
dest="variables",
default=None,
help="A var dict to pass to tests from the command line.",
help="""A var dict to pass to tests from the command line.
Example usage:
----------------------------------------------
Option: --variables='{"special":123}'
Access: self.variables["special"] # (123)
----------------------------------------------
Option: --variables='{"color":"red","num":42}'
Access: self.variables["color"] # ("red")
Access: self.variables["num"] # (42)
----------------------------------------------""",
)
parser.addoption(
"--cap_file",
Expand Down

0 comments on commit 94ba70b

Please sign in to comment.