File: conftest.py

package info (click to toggle)
napari-plugin-engine 0.2.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 432 kB
  • sloc: python: 3,052; makefile: 21
file content (27 lines) | stat: -rw-r--r-- 557 bytes parent folder | download
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
27
import pytest


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

    hookspec = HookSpecificationMarker("example")

    class Hooks:
        @hookspec
        def he_method1(self, arg):
            ...

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


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

    pm = PluginManager(project_name='example')
    return pm