Skip to content

Commit 51ee7f8

Browse files
committed
Fixup things after rebase
Some changes to make things work on top of current features branch.
1 parent 743f59a commit 51ee7f8

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

_pytest/assertion/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import os
66
import sys
77

8-
from _pytest.monkeypatch import monkeypatch
98
from _pytest.assertion import util
109
from _pytest.assertion import rewrite
1110

@@ -79,7 +78,8 @@ def install_importhook(config, mode):
7978
config._assertstate = AssertionState(config, mode)
8079

8180
_load_modules(mode)
82-
m = monkeypatch()
81+
from _pytest.monkeypatch import MonkeyPatch
82+
m = MonkeyPatch()
8383
config._cleanup.append(m.undo)
8484
m.setattr(py.builtin.builtins, 'AssertionError',
8585
reinterpret.AssertionError) # noqa

_pytest/config.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -976,10 +976,7 @@ def _preparse(self, args, addopts=True):
976976
entrypoint_name = 'pytest11'
977977
self._consider_importhook(args, entrypoint_name)
978978
self.pluginmanager.consider_preparse(args)
979-
try:
980-
self.pluginmanager.load_setuptools_entrypoints(entrypoint_name)
981-
except ImportError as e:
982-
self.warn("I2", "could not load setuptools entry import: %s" % (e,))
979+
self.pluginmanager.load_setuptools_entrypoints(entrypoint_name)
983980
self.pluginmanager.consider_env()
984981
self.known_args_namespace = ns = self._parser.parse_known_args(args, namespace=self.option.copy())
985982
if self.known_args_namespace.confcutdir is None and self.inifile:

testing/test_config.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,14 @@ def test_setuptools_importerror_issue1479(testdir, monkeypatch):
400400
pkg_resources = pytest.importorskip("pkg_resources")
401401
def my_iter(name):
402402
assert name == "pytest11"
403+
class Dist:
404+
project_name = 'spam'
405+
version = '1.0'
406+
def _get_metadata(self, name):
407+
return ['foo.txt,sha256=abc,123']
403408
class EntryPoint:
404409
name = "mytestplugin"
405-
dist = None
410+
dist = Dist()
406411
def load(self):
407412
raise ImportError("Don't hide me!")
408413
return iter([EntryPoint()])
@@ -697,4 +702,4 @@ def test_multiple_options(pytestconfig):
697702
"ini2:url=/tmp/user2?a=b&d=e",
698703
"ini3:True",
699704
"ini4:False"
700-
])
705+
])

0 commit comments

Comments
 (0)