diff --git a/httprunner/loader.py b/httprunner/loader.py index 880d5918..a7a9fabd 100644 --- a/httprunner/loader.py +++ b/httprunner/loader.py @@ -427,8 +427,6 @@ def load_project_meta(test_path: Text, reload: bool = False) -> ProjectMeta: # locate PWD and load debugtalk.py functions project_meta.PWD = project_working_directory project_meta.functions = debugtalk_functions - project_meta.test_path = os.path.abspath(test_path)[ - len(project_working_directory) + 1 : - ] + project_meta.debugtalk_path = debugtalk_path return project_meta diff --git a/httprunner/models.py b/httprunner/models.py index 449f168f..cac1a32c 100644 --- a/httprunner/models.py +++ b/httprunner/models.py @@ -81,10 +81,10 @@ class TestCase(BaseModel): class ProjectMeta(BaseModel): debugtalk_py: Text = "" # debugtalk.py file content - functions: FunctionsMapping = {} + debugtalk_path: Text = "" # debugtalk.py file path + functions: FunctionsMapping = {} # functions defined in debugtalk.py env: Env = {} - PWD: Text = os.getcwd() - test_path: Text = None # run with specified test path + PWD: Text = os.getcwd() # project working directory, the path debugtalk.py located class TestsMapping(BaseModel):