How to tell py.test to skip certain directories?

后端 未结 8 1389
情话喂你
情话喂你 2021-02-06 20:07

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         


        
相关标签:
8条回答
  • 2021-02-06 20:47

    I solved the mystery: If a pytest section is found in one of the possible config files (pytest.ini, tox.ini and setup.cfg), pytest will not look for any others so be sure you define the py.test options in a single file.

    I would suggest using setup.cfg.

    0 讨论(0)
  • 2021-02-06 20:50

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

    [tool:pytest]
    norecursedirs = subpath/*
    

    whereas just norecursedirs = subpath didn't.

    0 讨论(0)
提交回复
热议问题