From 01dda129bae2744fdbf14127d0768269e578f143 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Wed, 6 Jan 2021 11:44:08 -0800 Subject: [PATCH] Shutdown httpd before destructing HTTPServer objects (#112) --- tests/conftest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index b24ab94c..a7c54e67 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -90,6 +90,7 @@ def local_http_server() -> HTTPServer: # Start a new thread, because httpd.serve_forever is blocking threading.Thread(target=httpd.serve_forever, name='Local Http Server', daemon=True).start() yield httpd + httpd.shutdown() @pytest.fixture(scope='session') @@ -119,6 +120,7 @@ def local_https_server() -> HTTPServer: # Start a new thread, because httpd.serve_forever is blocking threading.Thread(target=httpd.serve_forever, name='Local Https Server', daemon=True).start() yield httpd + httpd.shutdown() @pytest.fixture(scope='session')