Skip to content

Commit

Permalink
🔧 Allow negating --showlocals with --no-showlocals
Browse files Browse the repository at this point in the history
This is necessary for addopts=--showlocals where individual test runs
need to not show locals.
  • Loading branch information
tony committed Oct 14, 2022
1 parent 15ac034 commit d30dfd5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/_pytest/terminal.py
Expand Up @@ -178,6 +178,13 @@ def pytest_addoption(parser: Parser) -> None:
default=False,
help="Show locals in tracebacks (disabled by default)",
)
group._addoption(
"--no-showlocals",
action="store_false",
dest="showlocals",
default=True,
help="Show locals in tracebacks (disabled by default)",
)
group._addoption(
"--tb",
metavar="style",
Expand Down

0 comments on commit d30dfd5

Please sign in to comment.