diff --git a/src/labthings_fastapi/server/cli.py b/src/labthings_fastapi/server/cli.py index 66f854cd..a97c7701 100644 --- a/src/labthings_fastapi/server/cli.py +++ b/src/labthings_fastapi/server/cli.py @@ -161,7 +161,7 @@ def serve_from_cli( server = ThingServer.from_config(config, True if args.debug else False) if dry_run: return server - uvicorn.run(server.app, host=args.host, port=args.port) + uvicorn.run(server.app, host=args.host, port=args.port, ws="websockets-sansio") except BaseException as e: if args.fallback: print(f"Error: {e}") @@ -174,7 +174,7 @@ def serve_from_cli( ) ) - uvicorn.run(app, host=args.host, port=args.port) + uvicorn.run(app, host=args.host, port=args.port, ws="websockets-sansio") else: if isinstance(e, (ValidationError, ThingImportFailure)): print(f"Error reading LabThings configuration:\n{e}") diff --git a/tests/test_fallback.py b/tests/test_fallback.py index 56a367f1..e3a1136f 100644 --- a/tests/test_fallback.py +++ b/tests/test_fallback.py @@ -170,7 +170,7 @@ def test_actual_server_fallback(): # Starting the server is a SystemExit with pytest.raises(SystemExit, match="3") as excinfo: - uvicorn.run(server.app, port=5000) + uvicorn.run(server.app, port=5000, ws="websockets-sansio") server_error = excinfo.value assert server.startup_failure is not None assert server.startup_failure["thing"] == "bad_thing" diff --git a/tests/test_mjpeg_stream.py b/tests/test_mjpeg_stream.py index 0effde36..f00b43b1 100644 --- a/tests/test_mjpeg_stream.py +++ b/tests/test_mjpeg_stream.py @@ -78,4 +78,4 @@ def test_mjpeg_stream(client): assert isinstance(telly, Telly) telly.framerate = 6 telly.frame_limit = -1 - uvicorn.run(server.app, port=5000) + uvicorn.run(server.app, port=5000, ws="websockets-sansio")