Commit 83a21c2b by MK

都四次提交

parent 6b7bbce0
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: __init__.py
# Author: xxxxxxx
# Datetime: 2023/11/3 14:00
# Description:
#
# ---------------------------------------------------------------------------
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: __init__.py
# Author: xxxxxxx
# Datetime: 2023/11/3 14:01
# Description:
#
# ---------------------------------------------------------------------------
from InterfaceAutoTest.common.log import write_log
log = write_log()
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: db.py
# Author: xxxxxxx
# Datetime: 2023/11/3 14:23
# Description:
#
# ---------------------------------------------------------------------------
import pymysql
from common import log
from common.read_ini import ReadIni
from data_config.settings import *
from InterfaceAutoTest.common import log
from InterfaceAutoTest.common.read_ini import ReadIni
from InterfaceAutoTest.data_config.settings import *
class DB:
......
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: log.py
# Author: xxxxxxx
# Datetime: 2023/11/3 14:02
# Description:
#
# ---------------------------------------------------------------------------
import logging
import os
......
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: read_excel.py
# Author: xxxxxxx
# Datetime: 2023/11/3 14:31
# Description:
#
# ---------------------------------------------------------------------------
import openpyxl
from data_config.settings import *
from common import log
from common.read_ini import ReadIni
from common.read_json import read_json
from InterfaceAutoTest.data_config.settings import *
from InterfaceAutoTest.common import log
from InterfaceAutoTest.common.read_ini import ReadIni
from InterfaceAutoTest.common.read_json import read_json
class ReadExcel:
......
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: read_ini.py
# Author: xxxxxxx
# Datetime: 2023/11/3 14:05
# Description:
#
# ---------------------------------------------------------------------------
import configparser
import os
from common import log
from data_config.settings import *
from InterfaceAutoTest.common import log
from InterfaceAutoTest.data_config.settings import *
class ReadIni:
......
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: read_json.py
# Author: xxxxxxx
# Datetime: 2023/11/3 14:16
# Description:
#
# ---------------------------------------------------------------------------
import json
import os
from common import log
from InterfaceAutoTest.common import log
def read_json(filename):
......
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: settings.py
# Author: xxxxxxx
# Datetime: 2023/11/3 17:03
# Description:
#
# ---------------------------------------------------------------------------
# file节点名称====================
FILE = "file"
# file节点名称=key的名称===================
......
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: __init__.py
# Author: xxxxxxx
# Datetime: 2023/11/3 14:01
# Description:
#
# ---------------------------------------------------------------------------
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: requests_method.py
# Author: xxxxxxx
# Datetime: 2023/11/3 15:24
# Description:
#
# ---------------------------------------------------------------------------
import base64
import logging
import requests
from common import log
from common.read_ini import ReadIni
from data_config.settings import *
from InterfaceAutoTest.common import log
from InterfaceAutoTest.common.read_ini import ReadIni
from InterfaceAutoTest.data_config.settings import *
class RequestsMethod:
......
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: __init__.py
# Author: xxxxxxx
# Datetime: 2023/11/3 14:01
# Description:
#
# ---------------------------------------------------------------------------
[pytest]
;开启日志
; log_cli=true
;log_cli=true
;设置日志的级别,如果不设置级别的话,可以设置为NOTSET,如果要设置级别,级别可以有debug,info,warning,error,致命
; log_level=NOTSET
;log_level=NOTSET
;设置日志显示的信息格式
; log_format=%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s
;log_format=%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s
;设置日志中时间显示的格式
; log_date_format=%Y-%m-%d %H:%M:%S
;log_date_format=%Y-%m-%d %H:%M:%S
;每个py文件运行的时候追加的命令
; addopts=-vs
;addopts=-vs
;设置日志保存的文件
log_file=./report/log/bpm_接口自动化框架最新运行日志.log
......
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: __init__.py
# Author: xxxxxxx
# Datetime: 2023/11/3 17:37
# Description:
#
# ---------------------------------------------------------------------------
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: conftest.py
# Author: xxxxxxx
# Datetime: 2023/11/3 15:33
# Description:
#
# ---------------------------------------------------------------------------
import pytest
from common.db import DB
from requests_method.requests_method import RequestsMethod
from InterfaceAutoTest.common.db import DB
from InterfaceAutoTest.requests_method.requests_method import RequestsMethod
@pytest.fixture(scope="session")
......
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: test_bpm.py
# Author: xxxxxxx
# Datetime: 2023/11/3 15:33
# Description:
#
# ---------------------------------------------------------------------------
import pytest
from common import log
from common.read_excel import ReadExcel
from InterfaceAutoTest.common import log
from InterfaceAutoTest.common.read_excel import ReadExcel
import allure
......
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: __init__.py
# Author: xxxxxxx
# Datetime: 2023/11/3 14:01
# Description:
#
# ---------------------------------------------------------------------------
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: test_pytest_func.py
# Author: xxxxxxx
# Datetime: 2023/11/3 9:36
# Description:
#
# ---------------------------------------------------------------------------
import base64
import random
import pytest
......
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: __init__.py
# Author: xxxxxxx
# Datetime: 2023/11/3 17:38
# Description:
#
# ---------------------------------------------------------------------------
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: conftest.py
# Author: xxxxxxx
# Datetime: 2023/11/3 15:33
# Description:
#
# ---------------------------------------------------------------------------
import pytest
from common.db import DB
from requests_method.requests_method import RequestsMethod
from InterfaceAutoTest.common.db import DB
from InterfaceAutoTest.requests_method.requests_method import RequestsMethod
@pytest.fixture(scope="session")
......
# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName: test_57
# FileName: test_bpm.py
# Author: xxxxxxx
# Datetime: 2023/11/3 15:33
# Description:
#
# ---------------------------------------------------------------------------
import pytest
from common import log
from common.read_excel import ReadExcel
from common.read_ini import ReadIni
from InterfaceAutoTest.common import log
from InterfaceAutoTest.common.read_excel import ReadExcel
from InterfaceAutoTest.common.read_ini import ReadIni
import allure
excel_path = ReadIni().get_file_path("excel")
......
from common.log import write_log
log = write_log()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment