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)