fix: summary path

This commit is contained in:
debugtalk
2020-06-06 22:34:39 +08:00
parent be627549e1
commit 2697af09ac

View File

@@ -220,11 +220,8 @@ def generate_conftest_for_summary(args: List):
sys.exit(1)
project_meta = load_project_meta(test_path)
conftest_path = os.path.join(project_meta.RootDir, "conftest.py")
conftest_path = ensure_file_path_valid(conftest_path)
if os.path.isfile(conftest_path):
return
project_root_dir = ensure_file_path_valid(project_meta.RootDir)
conftest_path = os.path.join(project_root_dir, "conftest.py")
conftest_content = '''# NOTICE: Generated By HttpRunner.
import json
import os
@@ -292,8 +289,8 @@ def session_fixture(request):
'''
test_path = os.path.abspath(test_path)
logs_dir_path = os.path.join(project_meta.RootDir, "logs")
test_path_relative_path = test_path[len(project_meta.RootDir) + 1 :]
logs_dir_path = os.path.join(project_root_dir, "logs")
test_path_relative_path = test_path[len(project_root_dir) + 1 :]
if os.path.isdir(test_path):
file_foder_path = os.path.join(logs_dir_path, test_path_relative_path)