fix: catch ApiNotFound exception when loading testcases

This commit is contained in:
debugtalk
2019-12-29 16:21:23 +08:00
parent c46a3b0155
commit 9a353534ee
2 changed files with 3 additions and 0 deletions

View File

@@ -11,6 +11,7 @@
- fix: display validators in report when validate raised exception
- fix: eval validator python script before validating
- fix: do not strip string content when preparing lazy data
- fix: catch ApiNotFound exception when loading testcases
## 2.4.8 (2019-12-25)

View File

@@ -480,6 +480,8 @@ def load_cases(path, dot_env_path=None):
loaded_content = None
try:
loaded_content = load_test_file(path)
except exceptions.ApiNotFound as ex:
logger.log_warning("Invalid api reference in {}: {}".format(path, ex))
except exceptions.FileFormatError:
logger.log_warning("Invalid test file format: {}".format(path))