如何通过Pytest学习进行项目实战操作?

2026-05-21 15:141阅读0评论SEO基础
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计187个文字,预计阅读时间需要1分钟。

如何通过Pytest学习进行项目实战操作?

pytest项目结构说明:- files:文件- fixtures:pytest fixture- reports:allure测试报告- samples:示例代码- db:数据库- test_mysql.py:连接MySQL- http:requests请求- test_request.py:requests常见请求

如何通过Pytest学习进行项目实战操作?

一、pytest设计项目结构

项目结构说明:
files:文件
fixtures:pytest fixture
reports:allure测试报告
samples:示例代码
db:数据库
test_mysql.py:连接MySQL
http:requests请求
test_request.py:requests常见用法
test_request_monkey_patch.py:tep request猴子补丁测试
login_pay:登陆到下单流程
mvc:mvc接口用例分离示例(不推荐)
tep:极速写法(强烈推荐)
tests:测试用例
utils:工具
fastapi_mock.py:自带fastapi项目
http_client.py:tep request猴子补丁
mitm.py:mitmproxy抓包自动生成用例
.gitignore:Git忽略文件规则
conf.yaml:项目配置
conftest.py:pytest conftest
pytest.ini:pytest配置

本文共计187个文字,预计阅读时间需要1分钟。

如何通过Pytest学习进行项目实战操作?

pytest项目结构说明:- files:文件- fixtures:pytest fixture- reports:allure测试报告- samples:示例代码- db:数据库- test_mysql.py:连接MySQL- http:requests请求- test_request.py:requests常见请求

如何通过Pytest学习进行项目实战操作?

一、pytest设计项目结构

项目结构说明:
files:文件
fixtures:pytest fixture
reports:allure测试报告
samples:示例代码
db:数据库
test_mysql.py:连接MySQL
http:requests请求
test_request.py:requests常见用法
test_request_monkey_patch.py:tep request猴子补丁测试
login_pay:登陆到下单流程
mvc:mvc接口用例分离示例(不推荐)
tep:极速写法(强烈推荐)
tests:测试用例
utils:工具
fastapi_mock.py:自带fastapi项目
http_client.py:tep request猴子补丁
mitm.py:mitmproxy抓包自动生成用例
.gitignore:Git忽略文件规则
conf.yaml:项目配置
conftest.py:pytest conftest
pytest.ini:pytest配置