diff --git a/lilac/server.py b/lilac/server.py index 3cb7a8a70..2a6374da4 100644 --- a/lilac/server.py +++ b/lilac/server.py @@ -261,7 +261,7 @@ def open_browser() -> None: block = False try: - asyncio.get_event_loop() + asyncio.get_running_loop() except RuntimeError: block = True diff --git a/lilac/server_test.py b/lilac/server_test.py index 49a5419e4..0f94fa730 100644 --- a/lilac/server_test.py +++ b/lilac/server_test.py @@ -1,6 +1,5 @@ """Test our public REST API.""" import os -from time import sleep from fastapi.testclient import TestClient from pytest_mock import MockerFixture @@ -13,7 +12,7 @@ UserInfo, get_session_user, ) -from .server import app, start_server, stop_server +from .server import app client = TestClient(app) @@ -175,9 +174,3 @@ def user() -> UserInfo: ), auth_enabled=True, ) - - -def test_start_and_stop_server() -> None: - start_server() - sleep(1) - stop_server()