debian-forge/tools/test
Achilleas Koutsou 562d30cf59 tools/test: shell out to python3 to check for libdnf5
We run tests using tox to set up environments for different python
versions to test against.  The problem is that when a test shells out to
a python script, like osbuild-depsolve-dnf5, it's not run inside the
environment but in the system environment.  The `has_dnf5()` check
returns False because it fails to import dnf5 in the tox environment,
even though the script can be run and the test will succeed.

Use `python3 -c "import libdnf5"` to decide if the script is runnable
instead of using `importlib`.  This doesn't solve the problem of our
tests running python scripts in a different environment than the one (we
think) we are testing, but it will enable tests of osbuild-depsolve-dnf5
for now.
2024-04-23 07:42:09 +02:00
..
test_depsolve.py tools/test: shell out to python3 to check for libdnf5 2024-04-23 07:42:09 +02:00