diff --git a/tests/topotests/isis-topo1/test_isis_topo1.py b/tests/topotests/isis-topo1/test_isis_topo1.py index c855644e39..544671da57 100644 --- a/tests/topotests/isis-topo1/test_isis_topo1.py +++ b/tests/topotests/isis-topo1/test_isis_topo1.py @@ -165,15 +165,8 @@ def test_isis_route_installation(): continue for nexthop in route['nexthops']: - try: - nexthop.pop('interfaceIndex') - except KeyError: - pass - - try: - nexthop.pop('interfaceName') - except KeyError: - pass + nexthop.pop('interfaceIndex', None) + nexthop.pop('interfaceName', None) assertmsg = "Router '{}' routes mismatch".format(rname) assert topotest.json_cmp(actual, expected) is None, assertmsg