Pytest: Deselecting tests

后端 未结 5 876
臣服心动
臣服心动 2021-01-31 07:28

With pytest, one can mark tests using a decorator

@pytest.mark.slow
def some_slow_test():
    pass

Then, from the command line, one can tell py

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-31 08:14

    Looking through the pytest code (mark.py) and further experimentation shows the following seems to work:

    pytest -k "-slow -long"
    

    (Using the --collect-only option speeds up experimentation)

提交回复
热议问题