diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-10-01 19:14:11 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-01 19:14:11 -0400 |
| commit | dda524e843c0f47bffdde309cc612f89ff467df2 (patch) | |
| tree | c71c0ccb7f4e9ca0e4c1e1cb27fbcdc776d528a8 | |
| parent | 113296dc347224531b338903741e3ed01bc35580 (diff) | |
| parent | c8c265f5713bcc1e67bd61016d1a93e4f899c9ac (diff) | |
Merge pull request #5087 from opensourcerouting/topotest-skip-on-assert-failure
topotests: skip tests when any assert fails
| -rwxr-xr-x | tests/topotests/conftest.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/topotests/conftest.py b/tests/topotests/conftest.py index 49e48ba927..76b0ab017e 100755 --- a/tests/topotests/conftest.py +++ b/tests/topotests/conftest.py @@ -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)) |
