/
githubmirror
/
flask
Обзор
Документация
Войти
/
githubmirror
/
flask
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/test_subclassing.py
21 строка
480 B
David Lord
pass context through dispatch methods
20 сен 2025, 03:33
Не верифицирован
20 сен 2025, 03:33
6a64969
Код
Авторство
О чём код?
from io import StringIO import flask def test_suppressed_exception_logging(): class SuppressedFlask(flask.Flask): def log_exception(self, ctx, exc_info): pass out = StringIO() app = SuppressedFlask(__name__) @app.route("/") def index(): raise Exception("test") rv = app.test_client().get("/", errors_stream=out) assert rv.status_code == 500 assert b"Internal Server Error" in rv.data assert not out.getvalue()