From 41d66c5486f5d64f7c78893b640c3a8ee82b20eb Mon Sep 17 00:00:00 2001 From: wangobango Date: Wed, 1 Dec 2021 14:50:03 +0100 Subject: [PATCH] fixed tests --- tests/test_ayct_backend.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/test_ayct_backend.py b/tests/test_ayct_backend.py index 753ad7d..c0f33dd 100644 --- a/tests/test_ayct_backend.py +++ b/tests/test_ayct_backend.py @@ -5,15 +5,14 @@ import pytest from ayct_backend import create_app @pytest.fixture -def client(): +def app(): app = create_app() - app.config['TESTING'] = True - app.run(host = '0.0.0.0', port = 5000) - with app.test_client() as client: - with app.app_context(): - pass - yield client + yield app + +@pytest.fixture +def client(app): + yield app.test_client() def test_first_endpoint(client): rv = client.get("/hello")