commit
88ed1ab648
1
AUTHORS
1
AUTHORS
|
@ -186,3 +186,4 @@ Wouter van Ackooy
|
|||
Xuan Luong
|
||||
Xuecong Liao
|
||||
Zoltán Máté
|
||||
Roland Puntaier
|
||||
|
|
|
@ -417,7 +417,7 @@ class PytestPluginManager(PluginManager):
|
|||
# _pytest prefix.
|
||||
assert isinstance(modname, (six.text_type, str)), "module name as text required, got %r" % modname
|
||||
modname = str(modname)
|
||||
if self.get_plugin(modname) is not None:
|
||||
if self.is_blocked(modname) or self.get_plugin(modname) is not None:
|
||||
return
|
||||
if modname in builtin_plugins:
|
||||
importspec = "_pytest." + modname
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Fix issue about ``-p no:<plugin>`` having no effect.
|
|
@ -1 +1 @@
|
|||
iUpdate github "bugs" link in CONTRIBUTING.rst
|
||||
Update github "bugs" link in CONTRIBUTING.rst
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import absolute_import, division, print_function
|
||||
import sys
|
||||
import py
|
||||
import pytest
|
||||
|
||||
|
@ -459,9 +460,12 @@ def test_setuptools_importerror_issue1479(testdir, monkeypatch):
|
|||
testdir.parseconfig()
|
||||
|
||||
|
||||
def test_plugin_preparse_prevents_setuptools_loading(testdir, monkeypatch):
|
||||
@pytest.mark.parametrize('block_it', [True, False])
|
||||
def test_plugin_preparse_prevents_setuptools_loading(testdir, monkeypatch, block_it):
|
||||
pkg_resources = pytest.importorskip("pkg_resources")
|
||||
|
||||
plugin_module_placeholder = object()
|
||||
|
||||
def my_iter(name):
|
||||
assert name == "pytest11"
|
||||
|
||||
|
@ -477,14 +481,19 @@ def test_plugin_preparse_prevents_setuptools_loading(testdir, monkeypatch):
|
|||
dist = Dist()
|
||||
|
||||
def load(self):
|
||||
assert 0, "should not arrive here"
|
||||
return plugin_module_placeholder
|
||||
|
||||
return iter([EntryPoint()])
|
||||
|
||||
monkeypatch.setattr(pkg_resources, 'iter_entry_points', my_iter)
|
||||
config = testdir.parseconfig("-p", "no:mytestplugin")
|
||||
plugin = config.pluginmanager.getplugin("mytestplugin")
|
||||
assert plugin is None
|
||||
args = ("-p", "no:mytestplugin") if block_it else ()
|
||||
config = testdir.parseconfig(*args)
|
||||
config.pluginmanager.import_plugin("mytestplugin")
|
||||
if block_it:
|
||||
assert "mytestplugin" not in sys.modules
|
||||
assert config.pluginmanager.get_plugin('mytestplugin') is None
|
||||
else:
|
||||
assert config.pluginmanager.get_plugin('mytestplugin') is plugin_module_placeholder
|
||||
|
||||
|
||||
def test_cmdline_processargs_simple(testdir):
|
||||
|
|
Loading…
Reference in New Issue