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.
This commit is contained in:
Bruno Oliveira 2019-02-22 18:49:56 -03:00
parent 5b35241470
commit a68f4fd2b9
2 changed files with 8 additions and 8 deletions

View File

@ -209,7 +209,7 @@ class TestImportHookInstallation(object):
import spamplugin import spamplugin
return spamplugin return spamplugin
def iter_entry_points(name): def iter_entry_points(group, name=None):
yield DummyEntryPoint() yield DummyEntryPoint()
pkg_resources.iter_entry_points = iter_entry_points pkg_resources.iter_entry_points = iter_entry_points

View File

@ -514,8 +514,8 @@ def test_preparse_ordering_with_setuptools(testdir, monkeypatch):
pkg_resources = pytest.importorskip("pkg_resources") pkg_resources = pytest.importorskip("pkg_resources")
monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False) monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
def my_iter(name): def my_iter(group, name=None):
assert name == "pytest11" assert group == "pytest11"
class Dist(object): class Dist(object):
project_name = "spam" project_name = "spam"
@ -552,8 +552,8 @@ def test_setuptools_importerror_issue1479(testdir, monkeypatch):
pkg_resources = pytest.importorskip("pkg_resources") pkg_resources = pytest.importorskip("pkg_resources")
monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False) monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
def my_iter(name): def my_iter(group, name=None):
assert name == "pytest11" assert group == "pytest11"
class Dist(object): class Dist(object):
project_name = "spam" project_name = "spam"
@ -583,8 +583,8 @@ def test_plugin_preparse_prevents_setuptools_loading(testdir, monkeypatch, block
plugin_module_placeholder = object() plugin_module_placeholder = object()
def my_iter(name): def my_iter(group, name=None):
assert name == "pytest11" assert group == "pytest11"
class Dist(object): class Dist(object):
project_name = "spam" project_name = "spam"
@ -621,7 +621,7 @@ def test_plugin_preparse_prevents_setuptools_loading(testdir, monkeypatch, block
def test_disable_plugin_autoload(testdir, monkeypatch, parse_args, should_load): def test_disable_plugin_autoload(testdir, monkeypatch, parse_args, should_load):
pkg_resources = pytest.importorskip("pkg_resources") pkg_resources = pytest.importorskip("pkg_resources")
def my_iter(name): def my_iter(group, name=None):
raise AssertionError("Should not be called") raise AssertionError("Should not be called")
class PseudoPlugin(object): class PseudoPlugin(object):