Skip to content

Commit

Permalink
更新python环境版本为3.10 (#22)
Browse files Browse the repository at this point in the history
* 更新python环境版本为3.10

* 修复ci意外类型诊断
  • Loading branch information
wu-clan authored Aug 6, 2023
1 parent 22db4b7 commit 19c0274
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
name: lint ${{ matrix.python-version }}
strategy:
matrix:
python-version: ['3.8']
python-version: ['3.10']
fail-fast: false
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
rev: 23.3.0
hooks:
- id: black
language_version: python3.8
language_version: python3.10
args:
- '--skip-string-normalization'
- '--line-length'
Expand Down
2 changes: 1 addition & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ select = [
]
line-length = 120
format = "grouped"
target-version = "py38"
target-version = "py310"
cache-dir = "./httpfpt/.ruff_cache"
extend-exclude = ["httpfpt/conftest.py"]

Expand Down
34 changes: 6 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,24 @@
# HttpFpt

基于数据驱动的接口自动化测试框架

Http: http 请求,

F:fast,

pt:pytest
基于 HTTP 请求的快速数据驱动 pytest 接口自动化测试框架

## 功能点

- 多项目分级,自由切换,互不干扰
- 测试数据隔离,自动解析与验证
- 多环境自定义配置,不同数据文件可以选择不同的运行环境
- 动态环境配置,自动识别和应用当前请求所需的基础环境数据
- 测试数据错误定位(参数错误,重复测试用例ID...)
- 多环境自定义配置,不同用例可以选择不同的运行环境
- 动态环境配置,自动识别和应用当前请求所需的基础环境配置
- 动态参数化,可以通过全局变量,局部变量,缓存变量,关联变量等方式进行参数化
- 数据依赖,支持接口返回数据共享,轻松实现接口依赖
- 钩子函数,动态数据,自定义扩展等等由你自由发挥
- 钩子函数,支持调用自定义钩子函数,实现更多的自定义功能
- 日志记录,自动记录测试过程中的请求数据日志
- 多元化断言,json断言,sql断言,原生 python assert 断言
- 测试用例自动生成,可以根据接口测试数据自动生成测试用例
- 测试用例自动生成,可以根据测试数据文件自动生成测试用例
- 自动测试报告,html, allure
- 自动测试结果通知,飞书,钉钉,~~企业微信~~,邮箱
- ......

## 帮助

有关更多详细信息,请参阅 [文档](https://wu-clan.github.io/httpfpt_docs)

## 贡献

欢迎加入,如果你有好的想法,可以提交 issues 或 pr

对于 PR:

1. Fork 仓库
2. git clone 你的仓库
3. 创建虚拟环境 `python3 -m venv venv`
4. 激活虚拟环境 `source venv/bin/activate`
5. 创建分支 `git checkout -b my-new-feature`
6. 提交修改到分支 `git commit -am 'Add some feature'`
7. 执行 ruff 检查并修复 `ruff check . --fix`
8. 执行 pre-commit 检查并修复 `pre-commit run --all-files --verbose`
9. 提交分支 `git push origin my-new-feature`
10. 创建 PR
2 changes: 1 addition & 1 deletion httpfpt/utils/allure_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def allure_step(step: str, var: Union[str, dict]) -> None:
:param var: 操作步骤中的变量
:return:
"""
with allure.step(step):
with allure.step(step): # type: ignore
allure.attach(
body=json.dumps(var, ensure_ascii=False, indent=2) if isinstance(var, dict) else var,
name='JSON Serialize',
Expand Down
3 changes: 2 additions & 1 deletion pyrightconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"reportUnusedImport": "error",
"reportOptionalMemberAccess": false,
"reportOptionalSubscript": false,
"pythonVersion": "3.8"
"pythonVersion": "3.10",
"pythonPlatform": "All"
}

0 comments on commit 19c0274

Please sign in to comment.