tests: use proper unit test skip instead of prints 84/40484/4
authorKlement Sekera <klement.sekera@gmail.com>
Fri, 8 Mar 2024 09:24:46 +0000 (10:24 +0100)
committerOle Tr�an <otroan@employees.org>
Tue, 12 Mar 2024 19:33:12 +0000 (19:33 +0000)
Using unittest skip instead of print unclutters display by not printing
skip messages when not applicable, e.g. when somebody runs tests which
are unrelated to netns tests, e.g. with FILTER=vapi.

Type: fix
Fixes: e416893a59
Change-Id: Ie09e213249aa47da7e4ff484c3d072fbce3c2001
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
test/vm_vpp_interfaces.py

index ed2d55b..cb48fee 100644 (file)
@@ -126,7 +126,7 @@ def create_test(test_name, test, ip_version, mtu):
                 )
             )
         else:
-            print(
+            return unittest.skip(
                 f"Skipping test:{test_name} as mtu:{mtu} is "
                 f"invalid for TCP/IPv{ip_version}"
             )
@@ -146,8 +146,6 @@ def generate_vpp_interface_tests(tests, test_class):
                     generated tests are set as attributes.
     """
 
-    if config.skip_netns_tests:
-        print("Skipping netns tests")
     for test in tests:
         for ip_version in test_config["ip_versions"]:
             for mtu in test_config["mtus"]: