File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 33 Publishing-Client -> PubSubServer -> Subscribing->Client
44
55"""
6+
67import os
78import sys
89import pytest
910import uvicorn
1011import asyncio
1112from multiprocessing import Process , Event as ProcEvent
1213
13- from fastapi import APIRouter , FastAPI
14+ from fastapi import FastAPI
1415
1516from fastapi_websocket_rpc .logger import get_logger
1617
3536
3637def setup_server ():
3738 app = FastAPI ()
38- router = APIRouter ()
3939 # PubSub websocket endpoint
4040 endpoint = PubSubEndpoint ()
41- endpoint .register_route (router , path = "/pubsub" )
42- app .include_router (router )
41+ endpoint .register_route (app , path = "/pubsub" )
4342 uvicorn .run (app , port = PORT )
4443
4544
@@ -51,6 +50,7 @@ def setup_publishing_client():
5150 async def actual ():
5251 # Wait for other client to wake up before publishing to it
5352 CLIENT_START_SYNC .wait (5 )
53+ logger .info ("Client start sync done" )
5454 # Create a client and subscribe to topics
5555 client = PubSubClient ()
5656 client .start_client (uri )
@@ -62,7 +62,7 @@ async def actual():
6262 assert published .result
6363
6464 logger .info ("Starting async publishing client" )
65- asyncio .get_event_loop (). run_until_complete (actual ())
65+ asyncio .run (actual ())
6666
6767
6868@pytest .fixture (scope = "module" )
You can’t perform that action at this time.
0 commit comments