1、安装
pip3 install pytest
显示当前版本
pytest --version
2、pytest运行方式
测试代码:
class TestLogin():
def setup(self):
print("this is setUp")
def teardown(self):
print("this is tearDown")
def test_Login(self):
print("start login")
命令行形式(推荐)
pytest -s 要运行的文件