update conftest

This commit is contained in:
谈林海 2023-03-31 14:57:54 +08:00
parent 3be3e99237
commit 38075164e6
1 changed files with 2 additions and 8 deletions

View File

@ -5,6 +5,7 @@
import pytest
from pathlib import Path
from utils import config
from utils.path import root
from utils.log_control import logger
from utils.read_yaml_control import HandleYaml
@ -30,7 +31,7 @@ def pytest_generate_tests(metafunc):
'application/json')}
test_case = {
'case': data.get('case', {}),
'env': (str(host()) + str(test_data['common_inputs'].get('path', {})),
'env': (str(config.host) + str(test_data['common_inputs'].get('path', {})),
str(test_data['common_inputs'].get('method', ''))),
'inputs': data.get('inputs', {}),
'expectation': data.get('expectation', {})
@ -117,10 +118,3 @@ def cache():
"""返回一个字典,用作数据共享"""
yield HandleYaml(root / 'test_data/cache.yml')
def host():
"""获取配置文件中的域名"""
res_host = HandleYaml(root / 'config.yml').read_yaml()['host']
return res_host