@@ -135,9 +135,9 @@ async def test_list_tasks_invalid_pagination_type(
135135 )
136136 assert response .status_code == HTTPStatus .UNPROCESSABLE_ENTITY
137137 # Verify that the error points to the correct field
138- detail = response .json ()["detail " ][0 ]
139- assert detail ["loc" ][- 2 :] == ["pagination" , expected_field ]
140- assert detail ["type" ] in {"type_error.integer" , "int_parsing" , "int_type" }
138+ error = response .json ()["errors " ][0 ]
139+ assert error ["loc" ][- 2 :] == ["pagination" , expected_field ]
140+ assert error ["type" ] in {"type_error.integer" , "int_parsing" , "int_type" }
141141
142142
143143@pytest .mark .parametrize (
@@ -150,8 +150,8 @@ async def test_list_tasks_invalid_range(value: str, py_api: httpx.AsyncClient) -
150150 response = await py_api .post ("/tasks/list" , json = {"number_instances" : value })
151151 assert response .status_code == HTTPStatus .UNPROCESSABLE_ENTITY
152152 # Verify the error is for the correct field
153- detail = response .json ()["detail " ][0 ]
154- assert detail ["loc" ][- 1 ] == "number_instances"
153+ error = response .json ()["errors " ][0 ]
154+ assert error ["loc" ][- 1 ] == "number_instances"
155155
156156
157157@pytest .mark .parametrize (
@@ -171,9 +171,9 @@ async def test_list_tasks_invalid_inputs(
171171 response = await py_api .post ("/tasks/list" , json = payload )
172172 assert response .status_code == HTTPStatus .UNPROCESSABLE_ENTITY
173173 # Ensure we are failing for the field we provided
174- detail = response .json ()["detail " ][0 ]
174+ error = response .json ()["errors " ][0 ]
175175 expected_field = next (iter (payload ))
176- assert detail ["loc" ][- 1 ] == expected_field
176+ assert error ["loc" ][- 1 ] == expected_field
177177
178178
179179async def test_list_tasks_no_results_api_mapping (py_api : httpx .AsyncClient ) -> None :
0 commit comments