@@ -65,7 +65,7 @@ def client(env_config) -> Client:
6565
6666
6767@pytest .fixture (scope = "module" )
68- def example_graph (navability_https_client : NavAbilityClient , client : Client ):
68+ async def example_graph (navability_https_client : NavAbilityClient , client : Client ):
6969 variables = [
7070 Variable ("x0" , VariableType .Pose2 .value ),
7171 Variable ("x1" , VariableType .Pose2 .value ),
@@ -105,23 +105,23 @@ def example_graph(navability_https_client: NavAbilityClient, client: Client):
105105 ]
106106 # Variables
107107 result_ids = [
108- addVariable (navability_https_client , client , v ) for v in variables
109- ] + [addFactor (navability_https_client , client , f ) for f in factors ]
108+ await addVariable (navability_https_client , client , v ) for v in variables
109+ ] + [await addFactor (navability_https_client , client , f ) for f in factors ]
110110
111111 logging .info (f"[Fixture] Adding variables and factors, waiting for completion" )
112112
113- waitForCompletion (navability_https_client , result_ids , maxSeconds = 120 )
113+ await waitForCompletion (navability_https_client , result_ids , maxSeconds = 120 )
114114
115115 return (navability_https_client , client , variables , factors )
116116
117117
118118@pytest .fixture (scope = "module" )
119- def example_graph_solved (example_graph ):
119+ async def example_graph_solved (example_graph ):
120120 """Get the graph after it has been solved.
121121 NOTE this changes the graph, so tests need to be defensive.
122122 """
123123 navability_https_client , client , variables , factors = example_graph
124124 logging .info (f"[Fixture] Solving graph, client = { client .dumps ()} " )
125- requestId = solveSession (navability_https_client , client )
126- waitForCompletion (navability_https_client , [requestId ], maxSeconds = 180 )
125+ requestId = await solveSession (navability_https_client , client )
126+ await waitForCompletion (navability_https_client , [requestId ], maxSeconds = 180 )
127127 return (navability_https_client , client , variables , factors )
0 commit comments