update conftest
This commit is contained in:
parent
3be3e99237
commit
38075164e6
10
conftest.py
10
conftest.py
|
@ -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
|
Loading…
Reference in New Issue