How to tell py.test to skip certain directories?

sorin picture sorin · Jun 20, 2012 · Viewed 49.6k times · Source

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!

Answer

shadfc picture shadfc · Jan 30, 2017

py.test --ignore=somedir worked for me