From 102945b8cbe6d0f8cb900082bc46b7f57b01c7cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jiri=20Dan=C4=9Bk?= Date: Thu, 26 May 2022 13:11:04 +0200 Subject: [PATCH] remove the r = Qdrouterd() pattern, use context Make sure a router exits if an initial HTTP listener fails, doesn't hang ... FAIL /usr/lib64/python3.10/unittest/case.py:613: ResourceWarning: unclosed file <_io.BufferedWriter name=6> outcome.errors.clear() ResourceWarning: Enable tracemalloc to get the object allocation traceback --- tests/system_tests_http.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/system_tests_http.py b/tests/system_tests_http.py index 360aef7e5..6f50e8c45 100644 --- a/tests/system_tests_http.py +++ b/tests/system_tests_http.py @@ -86,8 +86,8 @@ def test_listen_error(self): ('router', {'mode': 'standalone', 'id': 'bad'}), ('listener', {'port': listen_port, 'maxFrameSize': '2048', 'stripAnnotations': 'no'}), ('listener', {'port': listen_port, 'http': True})]) - r = Qdrouterd(name="expect_fail", config=config, wait=False) - self.assertEqual(1, r.wait()) + with Qdrouterd(name="expect_fail", config=config, wait=False) as r: + self.assertEqual(1, r.wait()) def is_get_request_failing(self, url, use_ca=True, use_get_cert=False): try: