Flask 3 · Testing and deployment
Create a pytest fixture
Make a test client available to tests.
import pytest
@pytest.fixture
def client():
app = create_app()
app.config["TESTING"] = True
return app.test_client()
Official Flask 3 documentation