pytest 安装 和 使用

"""
pytest get started
"""
#  安装pytest
print('pip install -U pytest')

#  获取pytest的版本号
print("pytest --version")


# pytest 用例收集机制
print("Pytest将在当前目录及其子目录中运行表单test_*.py或*_test.py的所有文件。测试类以Test开头,测试函数以test_*开头")

# 执行文件并简短输出报告
print('python -q test_*.py') or print('python --quiet test_*.py')

 

posted @ 2022-06-17 23:13  以小博大  阅读(49)  评论(0)    收藏  举报