/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
contrib/python/MarkupSafe/py2/tests/test_exception_custom_html.py
21 строка
510 B
wilytiger
support building opensource nbs with ya make
09 окт 2023, 17:33
09 окт 2023, 17:33
759d542
Код
Авторство
О чём код?
# -*- coding: utf-8 -*- import pytest from markupsafe import escape class CustomHtmlThatRaises(object): def __html__(self): raise ValueError(123) def test_exception_custom_html(): """Checks whether exceptions in custom __html__ implementations are propagated correctly. There was a bug in the native implementation at some point: https://github.com/pallets/markupsafe/issues/108 """ obj = CustomHtmlThatRaises() with pytest.raises(ValueError): escape(obj)