How to tell py.test to skip certain directories?

2020-05-29 12:39发布

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:pytest]
norecursedirs=lib/third

When I run py.test I do see how it does get tests from inside lib/third!

7条回答
Animai°情兽
2楼-- · 2020-05-29 13:20

In my case, the issue was the missing wildcard. The following works for me:

[tool:pytest]
norecursedirs = subpath/*

whereas just norecursedirs = subpath didn't.

查看更多
登录 后发表回答