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",