mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-12 16:01:27 +08:00
add testcase file path check
This commit is contained in:
@@ -68,6 +68,9 @@ def main_ate():
|
|||||||
except exception.FileFormatError:
|
except exception.FileFormatError:
|
||||||
success = False
|
success = False
|
||||||
continue
|
continue
|
||||||
|
except exception.FileNotFoundError:
|
||||||
|
success = False
|
||||||
|
continue
|
||||||
|
|
||||||
output_folder_name = os.path.basename(os.path.splitext(testset_path)[0])
|
output_folder_name = os.path.basename(os.path.splitext(testset_path)[0])
|
||||||
kwargs = {
|
kwargs = {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
import logging
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from ate import runner, testcase, utils
|
from ate import exception, runner, testcase, utils
|
||||||
|
|
||||||
|
|
||||||
class ApiTestCase(unittest.TestCase):
|
class ApiTestCase(unittest.TestCase):
|
||||||
@@ -50,6 +51,8 @@ class TaskSuite(unittest.TestSuite):
|
|||||||
super(TaskSuite, self).__init__()
|
super(TaskSuite, self).__init__()
|
||||||
self.suite_list = []
|
self.suite_list = []
|
||||||
testsets = testcase.load_testcases_by_path(testcase_path)
|
testsets = testcase.load_testcases_by_path(testcase_path)
|
||||||
|
if not testsets:
|
||||||
|
raise exception.FileNotFoundError
|
||||||
|
|
||||||
for testset in testsets:
|
for testset in testsets:
|
||||||
suite = ApiTestSuite(testset)
|
suite = ApiTestSuite(testset)
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ def load_testcases_by_path(path):
|
|||||||
testcases_list = []
|
testcases_list = []
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
logging.error("file not found: {}".format(path))
|
||||||
testcases_list = []
|
testcases_list = []
|
||||||
|
|
||||||
testcases_cache_mapping[path] = testcases_list
|
testcases_cache_mapping[path] = testcases_list
|
||||||
|
|||||||
Reference in New Issue
Block a user