From: Rafael Zalamena Date: Thu, 29 Jun 2017 13:49:11 +0000 (-0300) Subject: topogen: don't backtrace when topogen is not used X-Git-Tag: frr-7.1-dev~151^2~295 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=8833a8387fd085a6f7af80bd2a53c1a3f4d8e67d;p=mirror%2Ffrr.git topogen: don't backtrace when topogen is not used This allows old tests to be run with '--topology-only' without generating tons of error messages, instead it will just stop the test without trying anything else. --- diff --git a/tests/topotests/conftest.py b/tests/topotests/conftest.py old mode 100644 new mode 100755 index e042a3d13a..a8bc539943 --- a/tests/topotests/conftest.py +++ b/tests/topotests/conftest.py @@ -21,6 +21,9 @@ def pytest_runtest_call(): # pylint: disable=E1101 # Trust me, 'config' exists. if pytest.config.getoption('--topology-only'): - # Allow user to play with the setup. - get_topogen().mininet_cli() + tgen = get_topogen() + if tgen is not None: + # Allow user to play with the setup. + tgen.mininet_cli() + pytest.exit('the topology executed successfully')