HomeSoftware Heritage

Prevent root conftest.py from loading swh.core at module loading time

Description

Prevent root conftest.py from loading swh.core at module loading time

move the import statement in swhmain() body.
Having the swh.core module loaded with the execution of conftest.py can
have weird side effects, especially on pytest's discovery mechanism in
the context of tox, namely make pytest load test files from the source
directory rather than from the installed package in the tox venv,
potentially leading to ImportPathMismatchError.

Details

Provenance
douarddaAuthored on Feb 15 2022, 2:14 PM
douarddaPushed on Feb 17 2022, 1:55 PM
Differential Revision
D7189: Prevent root conftest.py from loading swh.core at module loading time
Parents
rDCORE1bee4ce598c2: Add a documentation section for swh.core.db
Branches
Unknown
Tags
Unknown
References
tag: v2.0.0
Build Status
Buildable 26966
Build 42165: test-and-buildJenkins console · Jenkins