Skip to content
Discussion options

You must be logged in to vote

How do you invoke pytest when this error happens?

Also, with --import-mode=importlib you might have better luck without some of the __init__.py files.

But more generally, such a layout is something that pytest currently doesn't handle. By which I mean, pytest doesn't support the concept of "workspaces"/multiple roots/monorepo layout. It currently assumes that all code is running in the same namespace. So if you have two roots AAA and BBB, both have their own tests.unit.conftest and pytest can't handle it, it wants just one.

It doesn't mean you can't use pytest, just that you can't use a single pytest invocation to test both roots at the same time. You should run pytest AAA and pytest BBB

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@johnmiaoncs
Comment options

@bluetech
Comment options

Answer selected by johnmiaoncs
@johnmiaoncs
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants