1.使用pytest测试框架,只打印特定的case
```
import pytest
# 只跑特定的case
def fun(a, b):
return a / b
@pytest.mark.test
def test_case01():
assert fun(10,2)==5
assert fun('a','b')==None
@pytest.mark.test1
def test_case02():
assert fun(10,3)==3.3333
def test_case03():
assert fun(-9,1)==-9
```
在命令行输入:
pytest -m "test" (只运行test标记的case,必须使用""双引号)
pytest -m "test and not test1"(只运行test标记的case,不执行test1)
pytest -m "test|test1" (同时运行test和test1标记的case)