Skip to content

Commit

Permalink
Add ability to actually start a Portal instance purely for test purpo…
Browse files Browse the repository at this point in the history
…ses.
  • Loading branch information
dmichaels-harvard committed Dec 19, 2023
1 parent 60d6b75 commit bbc1d31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dcicutils/portal_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit bbc1d31

Please sign in to comment.