/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
contrib/python/yarl/tests/test_cached_property.py
30 строк
472 B
robot-contrib
Update contrib/python/yarl to 1.9.4
21 дек 2023, 10:31
21 дек 2023, 10:31
8b44eb4
Код
Авторство
О чём код?
import pytest from yarl._url import cached_property class A: def __init__(self): self._cache = {} @cached_property def prop(self): """Docstring.""" return 1 def test_reify(): a = A() assert 1 == a.prop def test_reify_class(): assert isinstance(A.prop, cached_property) assert "Docstring." == A.prop.__doc__ def test_reify_assignment(): a = A() with pytest.raises(AttributeError): a.prop = 123