KamranImaaz commented on code in PR #61140:
URL: https://github.com/apache/airflow/pull/61140#discussion_r2778915394


##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_pools.py:
##########
@@ -380,10 +372,10 @@ def test_should_respond_200(
         body = response.json()
 
         if response.status_code == 422:
-            for error in body["detail"]:
-                # pydantic version can vary in tests (lower constraints), we 
do not assert the url.
-                if "url" in error:
-                    del error["url"]
+            detail = response.json().get("detail")
+            assert detail is not None
+            assert "slots" in str(detail)
+            return

Review Comment:
   I changed this to avoid asserting the exact FastAPI/Pydantic error 
structure, which can change across versions. The test now will only check the 
422 error occurs and that the error is related to the slots field or not that's 
it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to