Skip to content

Commit

Permalink
Make pytest ending output less chatty (pytorch#82262)
Browse files Browse the repository at this point in the history
If you still want this in CI, we should have a separate CI only
configuration.  The current config is pretty unfriendly for local
development.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Pull Request resolved: pytorch#82262
Approved by: https://github.com/clee2000
  • Loading branch information
ezyang authored and pytorchmergebot committed Jul 28, 2022
1 parent 98b9dfa commit 677908e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 2 additions & 3 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -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
5 changes: 4 additions & 1 deletion torch/testing/_internal/common_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,11 @@ def addSkip(self, test, reason):
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
Expand Down

0 comments on commit 677908e

Please sign in to comment.