Skip to content

Commit 52a7382

Browse files
author
codewitching
committed
fix test client fixture
1 parent 12f7047 commit 52a7382

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_api.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1+
import pytest
2+
from flask import create_app
3+
4+
@pytest.fixture
5+
def client():
6+
app = create_app()
7+
app.config["TESTING"] = True
8+
return app.test_client()
9+
110
def test_divide_endpoint(client):
211
response = client.get("/divide")
312
assert response.status_code == 200
413
assert response.json["result"] == 5
14+
15+

0 commit comments

Comments
 (0)