From: Klement Sekera Date: Fri, 8 Mar 2024 09:24:46 +0000 (+0100) Subject: tests: use proper unit test skip instead of prints X-Git-Tag: v24.10-rc0~176 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=ceed1e3b816ebcf103b07e5a2dd004aabb2c4145;p=vpp.git tests: use proper unit test skip instead of prints 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 --- diff --git a/test/vm_vpp_interfaces.py b/test/vm_vpp_interfaces.py index ed2d55b834a..cb48fee6f6a 100644 --- a/test/vm_vpp_interfaces.py +++ b/test/vm_vpp_interfaces.py @@ -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"]: