I tried to use the norecursedirs option inside setup.cfg to tell py.test not to collect tests from certain directories but it seems it does ignore it.
[tool:pyte
In my case, the issue was the missing wildcard. The following works for me:
[tool:pytest] norecursedirs = subpath/*
whereas just norecursedirs = subpath didn't.
norecursedirs = subpath