File: conftest.py

package info (click to toggle)
python-pluggy 1.0.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 336 kB
  • sloc: python: 1,922; sh: 10; makefile: 5
file content (26 lines) | stat: -rw-r--r-- 497 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import pytest


@pytest.fixture(
    params=[lambda spec: spec, lambda spec: spec()],
    ids=["spec-is-class", "spec-is-instance"],
)
def he_pm(request, pm):
    from pluggy import HookspecMarker

    hookspec = HookspecMarker("example")

    class Hooks:
        @hookspec
        def he_method1(self, arg):
            return arg + 1

    pm.add_hookspecs(request.param(Hooks))
    return pm


@pytest.fixture
def pm():
    from pluggy import PluginManager

    return PluginManager("example")