import pytest
def func(x):
return x+1
def test_1():
assert func(4)==5
#assert func(3) == 5
#test_1()
if __name__=='__main__':
#pytest.main(['q','test_demo1.py'])
pytest.main(['test_demo1.py'])
pytest.main(['test_calc.py'])
执行结果
import pytest
def func(x):
return x+1
def test_1():
assert func(4)==5
#assert func(3) == 5
#test_1()
if __name__=='__main__':
#pytest.main(['q','test_demo1.py'])
pytest.main(['test_demo1.py'])
pytest.main(['test_calc.py'])
执行结果