Can we have common test utilities when running with --import-mode=importlib
?
#9109
-
The documentation for
For me this sounds like if the tests directory is a proper package, we can import from other modules within it. Unfortunately, I didn't get it working:
with from tests.utils import bar
def test_foo():
pass Running
I get similar errors if I change the import to Did I do something wrong in the setup or is the documentation misleading and importing from other test utilities is not supported for |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @pmeier,
The latter is true, There's #8964 about adding some support for that, but that discussion lost steam. |
Beta Was this translation helpful? Give feedback.
Hi @pmeier,
The latter is true,
--import-mode=importlib
will import your tests without modifyingsys.path
at all, which means tests cannot import from each other.There's #8964 about adding some support for that, but that discussion lost steam.