fix #189: remove file path dependency

This commit is contained in:
debugtalk
2018-08-23 16:11:26 +08:00
parent e2ba773e78
commit cb44fafebf
7 changed files with 17 additions and 39 deletions

View File

@@ -52,7 +52,7 @@ class HttpRunner(object):
{
"config": {
"name": "desc1",
"path": "",
"path": "", # optional
"variables": [], # optional
"request": {} # optional
},
@@ -79,15 +79,15 @@ class HttpRunner(object):
for testcase in path_or_testcases:
try:
test_path = os.path.dirname(testcase["config"]["path"])
loader.load_project_tests(test_path)
except KeyError:
pass
test_path = os.getcwd()
loader.load_project_tests(test_path)
else:
try:
test_path = os.path.dirname(path_or_testcases["config"]["path"])
loader.load_project_tests(test_path)
except KeyError:
pass
test_path = os.getcwd()
loader.load_project_tests(test_path)
testcases = path_or_testcases
else: