How to tell py.test to skip certain directories?

Solution 1:

py.test --ignore=somedir worked for me

Solution 2:

If you have several directories with different parents you can specify different --ignore parameters:

py.test --ignore=somedir --ignore=otherdir --ignore=etcdir

  • new option: --ignore will prevent specified path from collection.
    Can be specified multiple times.