Skip to content

tests: Fix pytest execution in local venv with editable install

As swh.objstorage.replayer is a sub-package in the swh.objstorage implicit namespace, pytest could not import the swh.objstorage.replayer modules as it could not find the swh.objstorage.replayer one, see https://jenkins.softwareheritage.org/job/DENV/job/run-all-tests/1609/artifact/swh-objstorage-replayer.log.

To fix that issue and ensure than tests can be run in a local venv but also with tox, remove the use of the --import-mode=importlib pytest option and use relative imports instead of absolute ones when required.

Merge request reports