From 4f405d162015375c3a758daf22f7fa8853e803f3 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Sat, 20 Jun 2020 00:33:42 +0800 Subject: [PATCH] change: code location --- httprunner/compat.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/httprunner/compat.py b/httprunner/compat.py index 7b11f130..966d4e89 100644 --- a/httprunner/compat.py +++ b/httprunner/compat.py @@ -268,9 +268,6 @@ def generate_conftest_for_summary(args: List): logger.error(f"No valid test path specified! \nargs: {args}") sys.exit(1) - project_meta = load_project_meta(test_path) - project_root_dir = project_meta.RootDir - conftest_path = os.path.join(project_root_dir, "conftest.py") conftest_content = '''# NOTICE: Generated By HttpRunner. import json import os @@ -337,6 +334,10 @@ def session_fixture(request): ''' + project_meta = load_project_meta(test_path) + project_root_dir = project_meta.RootDir + conftest_path = os.path.join(project_root_dir, "conftest.py") + test_path = os.path.abspath(test_path) logs_dir_path = os.path.join(project_root_dir, "logs") test_path_relative_path = test_path[len(project_root_dir) + 1 :]