<2>pytest:简单示例
目录:测试自动化学习 - pytest
说明:本篇博客基于pytest 6.2.5
python文件:demo.py
# content of test_sample.py
def inc(x):
return x + 1
def test_answer():
assert inc(3) == 5
运行方法
在终端中,执行pytest demo.py
目录:测试自动化学习 - pytest
说明:本篇博客基于pytest 6.2.5
python文件:demo.py
# content of test_sample.py
def inc(x):
return x + 1
def test_answer():
assert inc(3) == 5
在终端中,执行pytest demo.py