Skip to content

Commit

Permalink
tests/conftest.py: Translate pytest exit status to Automake convention
Browse files Browse the repository at this point in the history
Meson and ginsttest-runner expect the Automake convention and will
report a failure instead of a skipped test otherwise.

Resolves: #1575
  • Loading branch information
swick committed Jan 17, 2025
1 parent 7928c83 commit cc1e924
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ def pytest_configure() -> None:
ensure_umockdev_loaded()


def pytest_sessionfinish(session, exitstatus):
# Meson and ginsttest-runner expect tests to exit with status 77 if all
# tests were skipped
if exitstatus == pytest.ExitCode.NO_TESTS_COLLECTED:
session.exitstatus = 77


def ensure_environment_set() -> None:
env_vars = [
"XDG_DESKTOP_PORTAL_PATH",
Expand Down

0 comments on commit cc1e924

Please sign in to comment.