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

前端 未结 8 566
长情又很酷
长情又很酷 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 11:42

    If you have the same method name in two different classes and you just want to run one of them, this works:

    pytest tests.py -k 'TestClassName and test_method_name'
    

提交回复
热议问题