From b892762c09fb466fb7559c69201c5dd1c9b2b53f Mon Sep 17 00:00:00 2001 From: Krish0703-irl Date: Sun, 31 May 2026 13:19:55 +0530 Subject: [PATCH] fix: make test_ping deterministic --- backend/tests/test_ping.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/backend/tests/test_ping.py b/backend/tests/test_ping.py index f6e07a29..5449c6cb 100644 --- a/backend/tests/test_ping.py +++ b/backend/tests/test_ping.py @@ -1,10 +1,8 @@ from fastapi.testclient import TestClient from app.main import app -client = TestClient(app) - - def test_ping(): - response = client.get("/ping") - assert response.status_code == 200 - assert response.json() == {"message": "pong"} + with TestClient(app) as client: + response = client.get("/ping") + assert response.status_code == 200 + assert response.json() == {"message": "pong"} \ No newline at end of file