/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
contrib/python/MarkupSafe/py3/tests/test_leak.py
28 строк
556 B
wilytiger
support building opensource nbs with ya make
09 окт 2023, 17:33
09 окт 2023, 17:33
759d542
Код
Авторство
О чём код?
import gc import platform import pytest from markupsafe import escape @pytest.mark.skipif( escape.__module__ == "markupsafe._native", reason="only test memory leak with speedups", ) def test_markup_leaks(): counts = set() for _i in range(20): for _j in range(1000): escape("foo") escape("<foo>") escape("foo") escape("<foo>") if platform.python_implementation() == "PyPy": gc.collect() counts.add(len(gc.get_objects())) assert len(counts) == 1