aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2024-02-10 15:52:43 +0100
committerHarald Welte <laforge@osmocom.org>2024-02-10 16:07:06 +0100
commitc934cadaeb676c3f5bdd2474242e420edba0fb45 (patch)
treec73d33df6e67f5e45c2a489d8b2d6c919dcc16d5
parenteae5eb498ab543ea502ddcfb169e510e463f0c25 (diff)
vty_test_runner: Avoid bogus erro messages like "AssertionError: False is not true"
"self.assertTrue(False)" is abusing python unittests. If you want to fail, either call the fail() method, or simply raise an exception... Change-Id: Ib683d6e166a9fca22dd2eb26e066e47034cda750
-rwxr-xr-xtests/vty/vty_test_runner.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/vty/vty_test_runner.py b/tests/vty/vty_test_runner.py
index dff26c3..fce3654 100755
--- a/tests/vty/vty_test_runner.py
+++ b/tests/vty/vty_test_runner.py
@@ -131,7 +131,7 @@ class TestVTYSTP(TestVTYBase):
s.connect(('127.0.0.2',2905))
except socket.error as msg:
s.close()
- self.assertTrue(False)
+ self.fail("Failed to connect IPv4 socket: %s" % msg)
print("Connected to STP through SCTP (IPv4)")
s.close()
# IPv6:
@@ -141,7 +141,7 @@ class TestVTYSTP(TestVTYBase):
s.connect(('::1',2905))
except socket.error as msg:
s.close()
- self.assertTrue(False)
+ self.fail("Failed to connect IPv6 socket: %s" % msg)
print("Connected to STP through SCTP (IPv6)")
s.close()