Skip to content

Commit

Permalink
Merge pull request #191 from gauge-sh/evan/ga-199-tach-test-should-re…
Browse files Browse the repository at this point in the history
…turn-exit-code-zero-when-no-tests-run

tach test should exit with zero when no tests run
  • Loading branch information
emdoyle committed Jul 18, 2024
2 parents 6a8bd59 + 061e192 commit a9ebc17
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/tach/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ def pytest_terminal_summary(
)

exit_code = pytest.main(pytest_args, plugins=[pytest_plugin])

if exit_code == pytest.ExitCode.NO_TESTS_COLLECTED:
# Selective testing means running zero tests will happen regularly,
# so we do not want the default behavior of failing when no tests
# are collected.
exit_code = pytest.ExitCode.OK

return AffectedTestsResult(
exit_code=exit_code,
tests_ran_to_completion=pytest_plugin.tests_ran_to_completion,
Expand Down

0 comments on commit a9ebc17

Please sign in to comment.