Addopt --import-mode=importlib for pytest to prevent errors with importlib.metadata#203
Conversation
| --strict-markers | ||
| --verbose | ||
| """ | ||
| norecursedirs = ["dist", "build", ".tox"] |
There was a problem hiding this comment.
Probably having both norecursedirs and testpaths is redundant... (Note however that norecursedirs would give a wider selection of files to test (including for example docs).
docs/conf.py may be dangerous to evaluate as it adds the src folder to sys.path and as established in #200 that causes problems with importlib.metadata.
So we probably just want to remove norecursedirs in a follow-up PR.
There was a problem hiding this comment.
No, I don’t believe they are redundant, because you can manually pass in testpaths. That setting is just a default, while this one makes sure that things that might contain tests (like virtual environments) never get picked up.
|
The |
67b1b9a to
9c9e69a
Compare
|
@mtelka would this work for you? |
| all | ||
| testing | ||
| commands = | ||
| pytest --doctest-modules src |
There was a problem hiding this comment.
Removing the redundancy.
|
I'm happy to report that with git |
Closes #200
Possibly obviates #201
The key aspect for the solution seems to be a
pytestupdate and usingimportlibmode.