support/testing/tests/package/test_python_waitress: rework assertion

Like Yann E. Morin did for
support/testing/tests/package/test_python_django.py, adjust the logic
to avoid the weird "self.assertTrue(False, ...)" construct, and
instead test exit_code after the loop.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Thomas Petazzoni
2025-02-05 11:19:27 +01:00
parent 1d4a61247d
commit 824c660c75

View File

@@ -30,5 +30,4 @@ class TestPythonWaitress(TestPythonPackageBase):
if exit_code == 0:
self.assertEqual(output[0], 'Hello, World!')
break
else:
self.assertTrue(False, "Timeout while waiting for waitress server")
self.assertEqual(exit_code, 0, "Timeout while waiting for django server")