/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
contrib/python/pluggy/py3/tests/conftest.py
25 строк
549 B
wilytiger
support building opensource nbs with ya make
09 окт 2023, 17:33
09 окт 2023, 17:33
759d542
Код
Авторство
О чём код?
import pytest from pluggy import HookspecMarker from pluggy import PluginManager @pytest.fixture( params=[lambda spec: spec, lambda spec: spec()], ids=["spec-is-class", "spec-is-instance"], ) def he_pm(request, pm: PluginManager) -> PluginManager: hookspec = HookspecMarker("example") class Hooks: @hookspec def he_method1(self, arg: int) -> int: return arg + 1 pm.add_hookspecs(request.param(Hooks)) return pm @pytest.fixture def pm() -> PluginManager: return PluginManager("example")