From: Paul Vinciguerra Date: Wed, 13 Mar 2019 00:41:27 +0000 (-0700) Subject: Tests: Raise exception, don't raise string. X-Git-Tag: v19.04-rc1~235 X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=commitdiff_plain;h=c599c6f001bc28e1023fb5e74a27db37b1aae847 Tests: Raise exception, don't raise string. This was deprecated ~ python 2.4, and causes a TypeError as sideEffect. >>> raise "foo" Traceback (most recent call last): File "", line 1, in TypeError: exceptions must derive from BaseException Change-Id: I4117b6d60ae896eaa1ef2a73a323d8d241f8c3a7 Signed-off-by: Paul Vinciguerra --- diff --git a/test/test_geneve.py b/test/test_geneve.py index ebe95a0f1a0..4d6e3f5932a 100644 --- a/test/test_geneve.py +++ b/test/test_geneve.py @@ -113,7 +113,7 @@ class TestGeneve(BridgeDomain, VppTestCase): remote_address=cls.mcast_ip4n, mcast_sw_if_index=1, is_add=is_add, vni=vni) if r.sw_if_index == 0xffffffff: - raise "bad sw_if_index" + raise ValueError("bad sw_if_index: ~0") @classmethod def add_shared_mcast_dst_load(cls): diff --git a/test/test_gtpu.py b/test/test_gtpu.py index f5b1089757e..4b776285766 100644 --- a/test/test_gtpu.py +++ b/test/test_gtpu.py @@ -168,7 +168,7 @@ class TestGtpu(BridgeDomain, VppTestCase): teid=teid, is_add=is_add) if r.sw_if_index == 0xffffffff: - raise "bad sw_if_index" + raise ValueError("bad sw_if_index: ~0") @classmethod def add_shared_mcast_dst_load(cls): diff --git a/test/test_vxlan.py b/test/test_vxlan.py index 7e3ea50c2e4..5ded725abf6 100644 --- a/test/test_vxlan.py +++ b/test/test_vxlan.py @@ -111,7 +111,7 @@ class TestVxlan(BridgeDomain, VppTestCase): mcast_sw_if_index=1, is_add=is_add, vni=vni) if r.sw_if_index == 0xffffffff: - raise "bad sw_if_index" + raise ValueError("bad sw_if_index: ~0") @classmethod def add_shared_mcast_dst_load(cls): diff --git a/test/test_vxlan_gpe.py b/test/test_vxlan_gpe.py index 6ee33d59c9e..36661a9c1fa 100644 --- a/test/test_vxlan_gpe.py +++ b/test/test_vxlan_gpe.py @@ -114,7 +114,7 @@ class TestVxlanGpe(BridgeDomain, VppTestCase): vni=vni, is_add=is_add) if r.sw_if_index == 0xffffffff: - raise "bad sw_if_index" + raise ValueError("bad sw_if_index: ~0") @classmethod def add_shared_mcast_dst_load(cls):