A simple framework for building complex web applications.
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Flask provides comprehensive testing utilities including test clients for making requests and CLI runners for testing command-line interfaces.
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: ...class FlaskCliRunner:
def invoke(self, cli, args=None, input=None, env=None, **extra): ...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 == 200Install with Tessl CLI
npx tessl i tessl/pypi-flask