CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-flask

A simple framework for building complex web applications.

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

testing.mddocs/

Testing Support

Flask provides comprehensive testing utilities including test clients for making requests and CLI runners for testing command-line interfaces.

Capabilities

Test Client

class FlaskClient:
    def get(self, *args, **kwargs) -> TestResponse: ...
    def post(self, *args, **kwargs) -> TestResponse: ...
    def put(self, *args, **kwargs) -> TestResponse: ...
    def delete(self, *args, **kwargs) -> TestResponse: ...
    def patch(self, *args, **kwargs) -> TestResponse: ...
    def head(self, *args, **kwargs) -> TestResponse: ...
    def options(self, *args, **kwargs) -> TestResponse: ...

CLI Test Runner

class FlaskCliRunner:
    def invoke(self, cli, args=None, input=None, env=None, **extra): ...

Usage Examples

Basic Testing

import pytest
from flask import Flask

@pytest.fixture
def app():
    app = Flask(__name__)
    app.config['TESTING'] = True
    return app

@pytest.fixture
def client(app):
    return app.test_client()

def test_home(client):
    response = client.get('/')
    assert response.status_code == 200

Install with Tessl CLI

npx tessl i tessl/pypi-flask

docs

blueprints.md

cli.md

configuration.md

context-globals.md

core-application.md

helpers.md

index.md

json-support.md

request-response.md

routing.md

sessions.md

signals.md

templates.md

testing.md

tile.json