pytest:简单demo
python文件:demo.py
# content of test_sample.py
def inc(x):
return x + 1
def test_answer():
assert inc(3) == 5
运行:终端同级目录下,运行pytest demo.py
python文件:demo.py
# content of test_sample.py
def inc(x):
return x + 1
def test_answer():
assert inc(3) == 5
运行:终端同级目录下,运行pytest demo.py