Description
reproducer
We’d like to run our tests on an installed package instead of the development version, as we delete some files in our build process. We therefore don’t use editable installs.
I think the problem is that there seems to be no way to configure the import root used with the importlib import mode. The project rootdir gets passed here instead of something user configurable:
Lines 545 to 549 in c34eaaa
Which means that the following code will run module_name = module_name_from_path('<rootdir>/src/anndata/_types.py', '<rootdir>')
, i.e. module_name = 'src.anndata._types'
when it should be 'anndata._types'
Lines 524 to 525 in 9f3bdac
Without src/
layout, this works accidentally, as the module_name
happens to match the real module name, and the module only gets imported once.
Pytest 7.4.2