Skip to content

Commit 2b6622f

Browse files
committed
🔧 Negating --showlocals with --no-showlocals
This is necessary for addopts=--showlocals where individual test runs need to not show locals.
1 parent 15ac034 commit 2b6622f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/_pytest/terminal.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ def pytest_addoption(parser: Parser) -> None:
178178
default=False,
179179
help="Show locals in tracebacks (disabled by default)",
180180
)
181+
group._addoption(
182+
"--no-showlocals",
183+
action="store_false",
184+
dest="showlocals",
185+
help="Hide locals in tracebacks (negate --showlocals passed through addopts)",
186+
)
181187
group._addoption(
182188
"--tb",
183189
metavar="style",

0 commit comments

Comments
 (0)