Skip to content

Commit

Permalink
sources: skip librepo test if no librepo can be imported
Browse files Browse the repository at this point in the history
The librepo test has a similar issue as the dnf tests, we need
to use the system packages, c.f.
osbuild/containers#79

But ensure it is run as part of the unittests_as_user_smoke.
  • Loading branch information
mvo5 committed Jan 6, 2025
1 parent d6a7563 commit ffc4a06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
# The test_host.py:test_signals_on_separate_fd runs itself but that
# run will happen without the tox env so a pip/tox installed pytest
# will not be found, install the pytest package as a workaround
- run: sudo apt install -y tox python3-pytest
- run: sudo apt install -y tox python3-pytest python3-librepo
- name: "Run as user on default runer"
# Run with -n 16 as depsolve tests tend to be slow but fast when
# parallized, the runtime is around 1-2min with this setup.
Expand Down
6 changes: 5 additions & 1 deletion sources/test/test_librepo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/usr/bin/python3
from unittest.mock import patch

import librepo
try:
import librepo
except ImportError:
import pytest
pytest.skip("need librepo to run this test")
import pytest

from osbuild import testutil
Expand Down

0 comments on commit ffc4a06

Please sign in to comment.