However, pylibjuju is not installed as part of the requirements. This means that all tests fail with an error like:
ERROR tests/unit/test_data_interfaces.py::TestDatabaseProvides::test_database_requested_event - importlib.metadata.PackageNotFoundError: No package metadata was found for juju
This is fixed by installing pylibjuju. Alternatively, the version("juju") could be wrapped in a try/except, and you could fall back to a hard-coded version?
Note that there are still some other tests that fail for unrelated reasons (see canonical/operator#1088).
The tests use importlib.metadata to get the installed version of pylibjuju (tests/conftest.py):
However, pylibjuju is not installed as part of the requirements. This means that all tests fail with an error like:
This is fixed by installing pylibjuju. Alternatively, the
version("juju")
could be wrapped in a try/except, and you could fall back to a hard-coded version?Note that there are still some other tests that fail for unrelated reasons (see canonical/operator#1088).