Skip to content
Discussion options

You must be logged in to vote

Hi @astrojuanlu

The mismatch is real: pytest is ending up with two different copies of poliastro under the same import name.

Your conftest.py imports the installed copy from the tox environment, while collecting src for doctests causes pytest/pytest-doctestplus to encounter the source-tree copy. Once one copy has already been imported, pytest detects that the module being collected comes from a different path and raises ImportPathMismatchError.

I would not use PY_IGNORE_IMPORTMISMATCH=1 as the normal solution. It disables the safety check and can hide the fact that you are testing/importing a different copy than intended.

The preferred fix is to make each pytest invocation use one package…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by astrojuanlu
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