Merge pull request #5087 from opensourcerouting/topotest-skip-on-assert-failure

topotests: skip tests when any assert fails
This commit is contained in:
Donald Sharp 2019-10-01 19:14:11 -04:00 committed by GitHub
commit dda524e843
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,3 +74,9 @@ def pytest_runtest_makereport(item, call):
parent._previousfailed = item
logger.error('assert failed at "{}/{}": {}'.format(
modname, item.name, call.excinfo.value))
# (topogen) Set topology error to avoid advancing in the test.
tgen = get_topogen()
if tgen is not None:
# This will cause topogen to report error on `routers_have_failure`.
tgen.set_error('{}/{}'.format(modname, item.name))