Skip to content

Commit

Permalink
explicit status code in warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jhkennedy committed Nov 6, 2024
1 parent 2ae2220 commit d728b6f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ def pytest_sessionfinish(session, exitstatus):

failure_rate = (100.0 * session.testsfailed) / session.testscollected
if failure_rate <= ACCEPTABLE_FAILURE_RATE:
status_code = os.environ.get('EARTHACCESS_ALLOWABLE_FAILURE_STATUS_CODE', 99)
warn(
'\nWARNING: The integration test suite has been allowed to pass because the '
f'\nWARNING: The integration test suite has returned {status_code} because the '
'failure rate was less than a hardcoded threshold. For more details see:\n'
'tests/integration/conftest.py.'
)
session.exitstatus = os.environ.get('EARTHACCESS_ALLOWABLE_FAILURE_STATUS_CODE', 99)
session.exitstatus = status_code


@pytest.fixture
Expand Down

0 comments on commit d728b6f

Please sign in to comment.