fix #808: project_working_directory is not initialized when running passed in data structure

This commit is contained in:
debugtalk
2020-01-02 22:33:34 +08:00
parent 55d9820d8c
commit e35e0fb938
4 changed files with 11 additions and 2 deletions

View File

@@ -292,6 +292,8 @@ class HttpRunner(object):
if loader.is_test_path(path_or_tests):
return self.run_path(path_or_tests, dot_env_path, mapping)
elif loader.is_test_content(path_or_tests):
project_working_directory = path_or_tests.get("project_mapping", {}).get("PWD", os.getcwd())
loader.init_pwd(project_working_directory)
return self.run_tests(path_or_tests)
else:
raise exceptions.ParamsError("Invalid testcase path or testcases: {}".format(path_or_tests))