# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName:   test62
# FileName:      conftest.py
# Author:       lao_zhao
# Datetime:     2024/9/2 16:54
# Description:
# 
# ---------------------------------------------------------------------------
import pytest
import requests
from apiAutoTest_v3.common.db import DB


@pytest.fixture(scope="session")
def fix_req():
    # 创建Session对象
    sess = requests.sessions.Session()
    yield sess


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


@pytest.fixture(scope="session")
def fix_dependency():
    dependency_dict = {}
    yield dependency_dict


#
# 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")