# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName:   test61
# FileName:      conftest.py
# Author:       lao_zhao
# Datetime:     2024/7/12 14:40
# Description:
# 
# ---------------------------------------------------------------------------
import pytest

from APIAutoTest_v3_1.common.db import DB
from APIAutoTest_v3_1.request_method.request_method import RequestMethod


@pytest.fixture(scope="session")
def req_fix():
    req = RequestMethod()
    yield req


@pytest.fixture(scope="session")
def db_fix():
    db = DB()
    yield db
    db.close()


# def pytest_collection_modifyitems(items):
#     # item表示每个测试用例，解决用例名称中文显示问题
#     for item in items:
#         item.name = item.name.encode("utf-8").decode("unicode-escape")
#         item._nodeid = item._nodeid.encode("utf-8").decode("unicode-escape")