Page MenuHomeSoftware Heritage
Paste P544

about pytest-plugin out of the swh arborescence tree
ActivePublic

Authored by ardumont on Oct 8 2019, 11:49 AM.
17:09 <+douardda> and the pb should not happen if we put the plugin out of the swh package (i.e. ar the root of swh-core directory)
17:10 <+douardda> (I've reproduced the issue in a minimal src repo)
17:12 <+douardda> the problem seems to be that when the plugin lives under our package's hat, it's loaded very soon, thus swh.core is loaded but from the installed location (in the tox venv here)
17:13 <+douardda> so when the subsequent import statement for a conftest or a testfile occurs, it's looked under this package's root directory first
17:14 <+douardda> so the simple solution is to put this plugin in a dedicated python module not under the swh's (and especially the swh.core one I think) package
17:17 <+douardda> (unless we want to invoke the dark forces of Namespace Packages to achieve this quest)