Pytest使用
1. Pytest安装
1.1 pip安装
pip install pytest
也可以选择进入pycharm进行安装
1.2 安装校验
pytest --version
2. 运行方式
运行方式有三种
2.1 命令行
pytest -s 文件名.py
例如:
pytest -s test_demo.py
2.2 主函数
在测试文件中增加主函数
if __name__ == '__main__':
pytest.main(["-s", "test_demo.py"])
-s 表
原创
2020-08-28 08:44:23 ·
83 阅读 ·
0 评论