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

More testing and deployment commands

All testing and deployment commands · Flask 3 cheatsheet

Was this page helpful?