Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit61e55f6

Browse files
committed
优化代码结构
1 parentfbdbe83 commit61e55f6

File tree

5 files changed

+55
-8
lines changed

5 files changed

+55
-8
lines changed

‎main.py‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#! /usr/bin/env python
2+
importpytest
3+
4+
msg=r"""
5+
_ooOoo_
6+
o8888888o
7+
88" . "88
8+
(| -_- |)
9+
O\ = /O
10+
____/`---'\____
11+
. ' \\| |// `.
12+
/ \\||| : |||// \
13+
/ _||||| -:- |||||- \
14+
| | \\\ - /// | |
15+
| \_| ''\---/'' | |
16+
\ .-\__ `-` ___/-. /
17+
___`. .' /--.--\ `. . __
18+
."" '< `.___\_<|>_/___.' >'"".
19+
| | : `- \`.;`\ _ /`;.`/ - ` : | |
20+
\ \ `-. \_ __\ /__ _/ .-` / /
21+
======`-.____`-.___\_____/___.-`____.-'======
22+
`=---='
23+
.............................................
24+
佛祖保佑 永无BUG
25+
"""
26+
print(msg)
27+
28+
if__name__=='__main__':
29+
pytest.main()
30+
# os.system('allure generate ./temp -o ./reports --clean')

‎pytest.ini‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[pytest]
2+
# --alluredir ./temp --clean-alluredir --capture=no
3+
addopts = -vs --tb=short
4+
python_files = test_*.py *_test.py
5+
python_classes = Test*
6+
python_functions = test

‎readme.md‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,18 @@ YAML和Excel文件用于测试数据的管理和测试报告的生成,最后
2525

2626
##部署
2727

28-
1. 下载项目源码后,在根目录下找到**requirements.txt**文件,然后通过 pip工具安装 requirements.txt 依赖,执行命令:
28+
1. 下载项目源码后,在根目录下找到**requirements_dev.txt**文件,然后通过 pip工具安装项目运行依赖,执行命令:
2929

3030
```shell
3131
pip3 install -r requirements.txt
3232
```
3333

3434
[comment]:<>(- 下载并配置allure2,下载安装教程如下:https://blog.csdn.net/lixiaomei0623/article/details/120185069)
3535

36-
2.**config/local.yaml**文件中配置数据库参数和邮件参数,运行**user.sql**初始化数据库。
37-
3. 之后运行**main.py**,或在Terminal窗口cd到项目根目录后执行命令:
36+
2.**debug/config/local.yaml**文件中配置数据库参数和邮件参数。
37+
3.**debug/db**目录中找到**user.sql**并运行初始化数据库。
38+
4.**debug/flask_app**目录中运行**api.py**启动服务。
39+
5. 之后运行**main.py**,或在Terminal窗口cd到项目根目录后执行命令:
3840

3941
```shell
4042
pytest
@@ -44,11 +46,11 @@ pytest
4446

4547
```python
4648
from common.read.caseimport read_case
47-
fromcommon.request.automaticimport auto_request
49+
fromdebugimport auto_request
4850
from debug.script.conftestimport parametrize
4951

5052

51-
@parametrize(read_case("method.yaml"))
53+
@parametrize(read_case("debug/testcase/method.yaml"))
5254
asyncdeftest_get(case):
5355
await auto_request(case)
5456
```
@@ -57,7 +59,7 @@ async def test_get(case):
5759
# method.yaml
5860
-casename:get请求
5961
request:
60-
url:http://httpbin.org/get
62+
url:http://127.0.0.1:5000/get
6163
method:GET
6264
params:
6365
foo1:bar1

‎requirements.txt‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ jsonpath
66
pathlib2
77
pytest
88
openpyxl
9-
aiohttp
10-
Flask
9+
aiohttp

‎requirements_dev.txt‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
PyYAML
2+
Faker
3+
PyMySQL
4+
loguru
5+
jsonpath
6+
pathlib2
7+
pytest
8+
openpyxl
9+
aiohttp
10+
Flask

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp