summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/python-pytest-pluggy-compat.patch
blob: ac33b862e65730e6dc33777596901341f0f49988 (plain)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Fix test failures when built against Pluggy 0.9.

Taken from this upstream commit:
https://github.com/pytest-dev/pytest/commit/a68f4fd2b9e99c82476d0e04ebcf561aeddbcb2e

diff --git a/testing/test_assertion.py b/testing/test_assertion.py
index b659233eb..e4fe56c6f 100644
--- a/testing/test_assertion.py
+++ b/testing/test_assertion.py
@@ -209,7 +209,7 @@ def load(self, require=True, *args, **kwargs):
                     import spamplugin
                     return spamplugin
 
-            def iter_entry_points(name):
+            def iter_entry_points(group, name=None):
                 yield DummyEntryPoint()
 
             pkg_resources.iter_entry_points = iter_entry_points
diff --git a/testing/test_config.py b/testing/test_config.py
index f9f22a63e..1e29b83f1 100644
--- a/testing/test_config.py
+++ b/testing/test_config.py
@@ -514,8 +514,8 @@ def test_preparse_ordering_with_setuptools(testdir, monkeypatch):
     pkg_resources = pytest.importorskip("pkg_resources")
     monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
 
-    def my_iter(name):
-        assert name == "pytest11"
+    def my_iter(group, name=None):
+        assert group == "pytest11"
 
         class Dist(object):
             project_name = "spam"
@@ -552,8 +552,8 @@ def test_setuptools_importerror_issue1479(testdir, monkeypatch):
     pkg_resources = pytest.importorskip("pkg_resources")
     monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
 
-    def my_iter(name):
-        assert name == "pytest11"
+    def my_iter(group, name=None):
+        assert group == "pytest11"
 
         class Dist(object):
             project_name = "spam"
@@ -583,8 +583,8 @@ def test_plugin_preparse_prevents_setuptools_loading(testdir, monkeypatch, block
 
     plugin_module_placeholder = object()
 
-    def my_iter(name):
-        assert name == "pytest11"
+    def my_iter(group, name=None):
+        assert group == "pytest11"
 
         class Dist(object):
             project_name = "spam"
@@ -621,7 +621,7 @@ def load(self):
 def test_disable_plugin_autoload(testdir, monkeypatch, parse_args, should_load):
     pkg_resources = pytest.importorskip("pkg_resources")
 
-    def my_iter(name):
+    def my_iter(group, name=None):
         raise AssertionError("Should not be called")
 
     class PseudoPlugin(object):