aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt/web-platform-tests/tools/third_party/pluggy/testing/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wpt/web-platform-tests/tools/third_party/pluggy/testing/conftest.py')
-rw-r--r--tests/wpt/web-platform-tests/tools/third_party/pluggy/testing/conftest.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/tools/third_party/pluggy/testing/conftest.py b/tests/wpt/web-platform-tests/tools/third_party/pluggy/testing/conftest.py
new file mode 100644
index 00000000000..3d61a349c88
--- /dev/null
+++ b/tests/wpt/web-platform-tests/tools/third_party/pluggy/testing/conftest.py
@@ -0,0 +1,30 @@
+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(object):
+ @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")