Skip to content

Commit

Permalink
🔧 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 2b6622f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/_pytest/terminal.py
Expand Up @@ -178,6 +178,12 @@ 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",
help="Hide locals in tracebacks (negate --showlocals passed through addopts)",
)
group._addoption(
"--tb",
metavar="style",
Expand Down

0 comments on commit 2b6622f

Please sign in to comment.