How do I disable a test using pytest?

前端 未结 6 1944
终归单人心
终归单人心 2020-12-13 23:49

Let\'s say I have a bunch of tests:

def test_func_one():
    ...

def test_func_two():
    ...

def test_func_three():
    ...

Is there a dec

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-14 00:10

    If you want to skip the test but not hard code a marker, better use keyword expression to escape it.

    pytest test/test_script.py -k 'not test_func_one'
    

提交回复
热议问题