<2>pytest:简单示例

python文件:demo.py

# content of test_sample.py

def inc(x):
    return x + 1


def test_answer():
    assert inc(3) == 5

运行方法

在终端中,执行pytest demo.py

posted @ 2021-12-03 18:35  漓白白"  阅读(30)  评论(0编辑  收藏  举报