Is there a way to specify which pytest tests to run from a file?

前端 未结 8 587
长情又很酷
长情又很酷 2020-12-12 11:05

Is there a way to select pytest tests to run from a file? For example, a file foo.txt containing a list of tests to be executed:

tes         


        
8条回答
  •  生来不讨喜
    2020-12-12 12:03

    Maybe using pytest_collect_file() hook you can parse the content of a .txt o .yaml file where the tests are specify as you want, and return them to the pytest core.

    A nice example is shown in the pytest documentation. I think what you are looking for.

提交回复
热议问题