laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/35939?usp=email )
Change subject: vty_test_runner: Avoid bogus erro messages like "AssertionError: False is not true" ......................................................................
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 --- M tests/vty/vty_test_runner.py 1 file changed, 14 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/39/35939/1
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 @@ 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 @@ 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()