Skip to content

Commit cec9fda

Browse files
authored
explicitly closed fastapi test client (#92)
1 parent 9d3d9bf commit cec9fda

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/backends/rest/test_rest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ class TestRestServer:
88
@pytest.fixture(scope="class")
99
def client(self, assertable_controller):
1010
app = RestBackend(assertable_controller)._server._app
11-
return TestClient(app)
11+
with TestClient(app) as client:
12+
yield client
1213

1314
def test_read_int(self, assertable_controller, client):
1415
expect = 0

0 commit comments

Comments
 (0)