Skip to content

Commit a68f4fd

Browse files
committed
Fix test failures after pluggy 1.8 release
pluggy now calls iter_entry_points with different arguments, and tests which mocked that call need to be updated accordingly.
1 parent 5b35241 commit a68f4fd

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

testing/test_assertion.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def load(self, require=True, *args, **kwargs):
209209
import spamplugin
210210
return spamplugin
211211
212-
def iter_entry_points(name):
212+
def iter_entry_points(group, name=None):
213213
yield DummyEntryPoint()
214214
215215
pkg_resources.iter_entry_points = iter_entry_points

testing/test_config.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,8 @@ def test_preparse_ordering_with_setuptools(testdir, monkeypatch):
514514
pkg_resources = pytest.importorskip("pkg_resources")
515515
monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
516516

517-
def my_iter(name):
518-
assert name == "pytest11"
517+
def my_iter(group, name=None):
518+
assert group == "pytest11"
519519

520520
class Dist(object):
521521
project_name = "spam"
@@ -552,8 +552,8 @@ def test_setuptools_importerror_issue1479(testdir, monkeypatch):
552552
pkg_resources = pytest.importorskip("pkg_resources")
553553
monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
554554

555-
def my_iter(name):
556-
assert name == "pytest11"
555+
def my_iter(group, name=None):
556+
assert group == "pytest11"
557557

558558
class Dist(object):
559559
project_name = "spam"
@@ -583,8 +583,8 @@ def test_plugin_preparse_prevents_setuptools_loading(testdir, monkeypatch, block
583583

584584
plugin_module_placeholder = object()
585585

586-
def my_iter(name):
587-
assert name == "pytest11"
586+
def my_iter(group, name=None):
587+
assert group == "pytest11"
588588

589589
class Dist(object):
590590
project_name = "spam"
@@ -621,7 +621,7 @@ def load(self):
621621
def test_disable_plugin_autoload(testdir, monkeypatch, parse_args, should_load):
622622
pkg_resources = pytest.importorskip("pkg_resources")
623623

624-
def my_iter(name):
624+
def my_iter(group, name=None):
625625
raise AssertionError("Should not be called")
626626

627627
class PseudoPlugin(object):

0 commit comments

Comments
 (0)