diff --git a/testplan/testing/py_test.py b/testplan/testing/py_test.py index 367489a69..d3491597a 100644 --- a/testplan/testing/py_test.py +++ b/testplan/testing/py_test.py @@ -115,7 +115,10 @@ def run_tests(self): return_code = pytest.main( self._pytest_args, plugins=[self._pytest_plugin] ) - if return_code != 0: + if return_code == 5: + self.result.report.status_override = Status.UNSTABLE + self.logger.warning("No tests were run") + elif return_code != 0: self.result.report.status_override = Status.FAILED self.logger.error("pytest exited with return code %d", return_code) @@ -126,7 +129,7 @@ def _collect_tests(self): plugins=[self._collect_plugin], ) - if return_code != 0: + if return_code not in (0, 5): # rc 5: no tests were run raise RuntimeError( "Collection failure, exit code = {}".format(return_code) )