From bbc1d31c8f1dce9d156e997b05f575e4bc9d3d43 Mon Sep 17 00:00:00 2001 From: David Michaels Date: Tue, 19 Dec 2023 10:51:17 -0500 Subject: [PATCH] Add ability to actually start a Portal instance purely for test purposes. --- dcicutils/portal_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dcicutils/portal_utils.py b/dcicutils/portal_utils.py index dc332fc87..9ad536fda 100644 --- a/dcicutils/portal_utils.py +++ b/dcicutils/portal_utils.py @@ -404,11 +404,11 @@ def endpoint_wrapper(request): # noqa def start(self, port: int = 8080, asynchronous: bool = False) -> Optional[Thread]: if isinstance(self._vapp, TestApp) and hasattr(self._vapp, "app") and isinstance(self._vapp.app, PyramidRouter): def start_server() -> None: # noqa - with wsgi_make_server('0.0.0.0', port, self._vapp.app) as server: + with wsgi_make_server("0.0.0.0", port, self._vapp.app) as server: server.serve_forever() if asynchronous: server_thread = Thread(target=start_server) server_thread.daemon = True server_thread.start() return server_thread - start_server(self._vapp.app, port) + start_server()