Replies: 2 comments 1 reply
-
its a bug in the ide integration to pass in such paths by default testpaths are the go-to for when no path is goven any passed in path will overide them with that path |
Beta Was this translation helpful? Give feedback.
1 reply
-
Alternatively you can exclude certain directories so pytest will never collect from them by using collect_ignore_glob in the root |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
With a project structured like this:
We want to only ever run tests in these 3 directories specified by
testpaths
:This works fine invoking
pytest
without specifying any paths on the command line. But tools like the test explorer in VSCode will specify paths when invokingpytest
(e.g.pytest /path/to/project
orpytest .tests/
), and these paths causetestpaths
to be ignored. Pytest then getsModuleNotFoundErrors
and so on because it's looking intests/functional
.Essentially I am looking for a way to constrain the paths that Pytest uses to those contained within the paths specified in
pytest.ini
, buttestpaths
does not do this.Beta Was this translation helpful? Give feedback.
All reactions