Fixup things after rebase

Some changes to make things work on top of current features branch.
This commit is contained in:
Floris Bruynooghe 2016-07-14 12:42:29 +01:00
parent 743f59afb2
commit 51ee7f8734
3 changed files with 10 additions and 8 deletions

View File

@ -5,7 +5,6 @@ import py
import os
import sys
from _pytest.monkeypatch import monkeypatch
from _pytest.assertion import util
from _pytest.assertion import rewrite
@ -79,7 +78,8 @@ def install_importhook(config, mode):
config._assertstate = AssertionState(config, mode)
_load_modules(mode)
m = monkeypatch()
from _pytest.monkeypatch import MonkeyPatch
m = MonkeyPatch()
config._cleanup.append(m.undo)
m.setattr(py.builtin.builtins, 'AssertionError',
reinterpret.AssertionError) # noqa

View File

@ -976,10 +976,7 @@ class Config(object):
entrypoint_name = 'pytest11'
self._consider_importhook(args, entrypoint_name)
self.pluginmanager.consider_preparse(args)
try:
self.pluginmanager.load_setuptools_entrypoints(entrypoint_name)
except ImportError as e:
self.warn("I2", "could not load setuptools entry import: %s" % (e,))
self.pluginmanager.load_setuptools_entrypoints(entrypoint_name)
self.pluginmanager.consider_env()
self.known_args_namespace = ns = self._parser.parse_known_args(args, namespace=self.option.copy())
if self.known_args_namespace.confcutdir is None and self.inifile:

View File

@ -400,9 +400,14 @@ def test_setuptools_importerror_issue1479(testdir, monkeypatch):
pkg_resources = pytest.importorskip("pkg_resources")
def my_iter(name):
assert name == "pytest11"
class Dist:
project_name = 'spam'
version = '1.0'
def _get_metadata(self, name):
return ['foo.txt,sha256=abc,123']
class EntryPoint:
name = "mytestplugin"
dist = None
dist = Dist()
def load(self):
raise ImportError("Don't hide me!")
return iter([EntryPoint()])
@ -697,4 +702,4 @@ class TestOverrideIniArgs:
"ini2:url=/tmp/user2?a=b&d=e",
"ini3:True",
"ini4:False"
])
])