diff --git a/pytest.ini b/pytest.ini index 2c39e2695297..53b5ad643ebf 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,13 +1,12 @@ [pytest] addopts = # show summary of all tests that did not pass - -ra + -rEfX # Make tracebacks shorter --tb=native # capture only Python print and C++ py::print, but not C output (low-level Python errors) --capture=sys - # enable all warnings - -Wd + --disable-warnings testpaths = test junit_logging_reruns = all diff --git a/torch/testing/_internal/common_utils.py b/torch/testing/_internal/common_utils.py index ca67e55b243a..fe2ce450b4b0 100644 --- a/torch/testing/_internal/common_utils.py +++ b/torch/testing/_internal/common_utils.py @@ -726,8 +726,11 @@ def run_tests(argv=UNITTEST_ARGS): print(f'Test results will be stored in {pytest_report_path}') # mac slower on 4 proc than 3 num_procs = 3 if "macos" in os.environ["BUILD_ENVIRONMENT"] else 4 + # f = failed + # E = error + # X = unexpected success exit_code = pytest.main(args=[inspect.getfile(sys._getframe(1)), f'-n={num_procs}', '-vv', '-x', - '--reruns=2', '-rfEsX', f'--junit-xml-reruns={pytest_report_path}']) + '--reruns=2', '-rfEX', f'--junit-xml-reruns={pytest_report_path}']) del os.environ["USING_PYTEST"] sanitize_pytest_xml(f'{pytest_report_path}') # exitcode of 5 means no tests were found, which happens since some test configs don't