avoid undocumented special casing of "pytest_" prefix

--HG--
branch : plugin_no_pytest
This commit is contained in:
holger krekel 2015-04-22 13:44:37 +02:00
parent 20d6c0b560
commit 894d7dca22
4 changed files with 1 additions and 6 deletions

View File

@ -208,8 +208,6 @@ class PytestPluginManager(PluginManager):
try: try:
mod = importplugin(modname) mod = importplugin(modname)
except ImportError: except ImportError:
if modname.startswith("pytest_"):
return self.import_plugin(modname[7:])
raise raise
except Exception as e: except Exception as e:
import pytest import pytest

View File

@ -64,7 +64,7 @@ def test_parseconfig(testdir):
def test_testdir_runs_with_plugin(testdir): def test_testdir_runs_with_plugin(testdir):
testdir.makepyfile(""" testdir.makepyfile("""
pytest_plugins = "pytest_pytester" pytest_plugins = "pytester"
def test_hello(testdir): def test_hello(testdir):
assert 1 assert 1
""") """)

View File

@ -22,7 +22,6 @@ def test_WarningRecorder(recwarn):
def test_recwarn_functional(testdir): def test_recwarn_functional(testdir):
reprec = testdir.inline_runsource(""" reprec = testdir.inline_runsource("""
pytest_plugins = 'pytest_recwarn',
import warnings import warnings
oldwarn = warnings.showwarning oldwarn = warnings.showwarning
def test_method(recwarn): def test_method(recwarn):

View File

@ -3,7 +3,6 @@ import pytest
def test_simple_unittest(testdir): def test_simple_unittest(testdir):
testpath = testdir.makepyfile(""" testpath = testdir.makepyfile("""
import unittest import unittest
pytest_plugins = "pytest_unittest"
class MyTestCase(unittest.TestCase): class MyTestCase(unittest.TestCase):
def testpassing(self): def testpassing(self):
self.assertEquals('foo', 'foo') self.assertEquals('foo', 'foo')
@ -17,7 +16,6 @@ def test_simple_unittest(testdir):
def test_runTest_method(testdir): def test_runTest_method(testdir):
testdir.makepyfile(""" testdir.makepyfile("""
import unittest import unittest
pytest_plugins = "pytest_unittest"
class MyTestCaseWithRunTest(unittest.TestCase): class MyTestCaseWithRunTest(unittest.TestCase):
def runTest(self): def runTest(self):
self.assertEquals('foo', 'foo') self.assertEquals('foo', 'foo')