mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[CI] add new test config label ci-test-showlocals
to control test log verbosity (#131981)
Add a new label `ci-test-showlocals` and add it to test config filter. If the PR is labeled with `ci-test-showlocals` or "ci-test-showlocals" present in the PR comment, the test config filter will set a environment variable `TEST_SHOWLOCALS`. Then `pytest` will show local variables on failures for better debugging. Pull Request resolved: https://github.com/pytorch/pytorch/pull/131981 Approved by: https://github.com/malfet ghstack dependencies: #131151
This commit is contained in:
committed by
PyTorch MergeBot
parent
4694ee1ad2
commit
5cc34f61d1
@ -1129,14 +1129,14 @@ def parse_args():
|
||||
parser.add_argument(
|
||||
"--showlocals",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=False,
|
||||
default=strtobool(os.environ.get("TEST_SHOWLOCALS", "False")),
|
||||
help="Show local variables in tracebacks (default: True)",
|
||||
)
|
||||
else:
|
||||
parser.add_argument(
|
||||
"--showlocals",
|
||||
action="store_true",
|
||||
default=False,
|
||||
default=strtobool(os.environ.get("TEST_SHOWLOCALS", "False")),
|
||||
help="Show local variables in tracebacks (default: True)",
|
||||
)
|
||||
parser.add_argument("--no-showlocals", dest="showlocals", action="store_false")
|
||||
|
Reference in New Issue
Block a user