From 2b6622fdd3678c37cdd2fc13f404546ac1a76de6 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Fri, 14 Oct 2022 16:10:21 -0500 Subject: [PATCH] :wrench: Negating --showlocals with --no-showlocals This is necessary for addopts=--showlocals where individual test runs need to not show locals. --- src/_pytest/terminal.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 9739a467a..d967a3ee6 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -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",