From e3ba205699db054723578a32d1bf73276b0e58ad Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Thu, 23 Nov 2023 12:39:13 -0800 Subject: [PATCH 1/1] fetch: test: Explicitly join webserver thread --- paperdoorknob_test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paperdoorknob_test.py b/paperdoorknob_test.py index fafd1c3..b1d41d4 100644 --- a/paperdoorknob_test.py +++ b/paperdoorknob_test.py @@ -36,11 +36,13 @@ class TestFetch(unittest.TestCase): def setUp(self) -> None: web_server = HTTPServer(('', 0), FakeGlowficHTTPRequestHandler) self._port = web_server.socket.getsockname()[1] - threading.Thread(target=web_server.serve_forever).start() + self._thread = threading.Thread(target=web_server.serve_forever) + self._thread.start() self._stop_server = web_server.shutdown def tearDown(self) -> None: self._stop_server() + self._thread.join() def testFetch(self) -> None: paperdoorknob.fetch(f"http://localhost:{self._port}", TIMEOUT) -- 2.44.1