print warning message when no testcase found

This commit is contained in:
debugtalk
2018-03-21 14:21:50 +08:00
parent 8c618d2325
commit 8b7bbb4171
3 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
__title__ = 'HttpRunner' __title__ = 'HttpRunner'
__description__ = 'One-stop solution for HTTP(S) testing.' __description__ = 'One-stop solution for HTTP(S) testing.'
__url__ = 'https://github.com/HttpRunner/HttpRunner' __url__ = 'https://github.com/HttpRunner/HttpRunner'
__version__ = '1.2.0-beta' __version__ = '1.2.1-beta'
__author__ = 'debugtalk' __author__ = 'debugtalk'
__author_email__ = 'mail@debugtalk.com' __author_email__ = 'mail@debugtalk.com'
__license__ = 'MIT' __license__ = 'MIT'
+1
View File
@@ -215,6 +215,7 @@ class HttpRunner(object):
mapping = mapping or {} mapping = mapping or {}
task_suite = TaskSuite(self.path, mapping) task_suite = TaskSuite(self.path, mapping)
except exception.TestcaseNotFound: except exception.TestcaseNotFound:
logger.log_error("Testcases not found in {}".format(self.path))
sys.exit(1) sys.exit(1)
result = self.runner.run(task_suite) result = self.runner.run(task_suite)
+3
View File
@@ -485,6 +485,9 @@ def load_test_file(file_path):
api_info.update(item["api"]) api_info.update(item["api"])
testset["api"][func_name] = api_info testset["api"][func_name] = api_info
else:
logger.log_warning("unexpected block: {}. block should only be config or test.".format(key))
return testset return testset
def get_testinfo_by_reference(ref_name, ref_type): def get_testinfo_by_reference(ref_name, ref_type):