kumquat-buildroot/support/testing/tests/package/test_python_treq.py
Ricardo Martincoski ef5e87bb92 support/testing: make treq tests to ignore warning
Newer versions of python-treq display a warning at runtime when
service_identity is not installed:
"Without the service_identity module, Twisted can perform only
rudimentary TLS client hostname verification."

This warning message confuses the test that looks for another string in
stdout. Make the test ignore other messages while still expecting
"Connection refused".

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/269139449
https://gitlab.com/buildroot.org/buildroot/-/jobs/269139450

Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-08-11 14:17:28 +02:00

31 lines
861 B
Python

from tests.package.test_python import TestPythonPackageBase
class TestPythonTreq(TestPythonPackageBase):
sample_scripts = ["tests/package/sample_python_treq.py"]
def run_sample_scripts(self):
cmd = self.interpreter + " sample_python_treq.py"
output, exit_code = self.emulator.run(cmd, timeout=20)
refuse_msgs = [1 for l in output if "Connection refused" in l]
self.assertGreater(sum(refuse_msgs), 0)
self.assertEqual(exit_code, 0)
class TestPythonPy2Treq(TestPythonTreq):
__test__ = True
config = TestPythonTreq.config + \
"""
BR2_PACKAGE_PYTHON=y
BR2_PACKAGE_PYTHON_TREQ=y
"""
class TestPythonPy3Treq(TestPythonTreq):
__test__ = True
config = TestPythonTreq.config + \
"""
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON_TREQ=y
"""