New-style classes implemented for python 2.7 - #2147
This commit is contained in:
@@ -11,7 +11,7 @@ from _pytest.main import EXIT_NOTESTSCOLLECTED, Session
|
||||
def pytestpm():
|
||||
return PytestPluginManager()
|
||||
|
||||
class TestPytestPluginInteractions:
|
||||
class TestPytestPluginInteractions(object):
|
||||
def test_addhooks_conftestplugin(self, testdir):
|
||||
testdir.makepyfile(newhooks="""
|
||||
def pytest_myhook(xyz):
|
||||
@@ -85,7 +85,7 @@ class TestPytestPluginInteractions:
|
||||
config = testdir.parseconfig()
|
||||
l = []
|
||||
|
||||
class A:
|
||||
class A(object):
|
||||
def pytest_configure(self, config):
|
||||
l.append(self)
|
||||
|
||||
@@ -105,11 +105,11 @@ class TestPytestPluginInteractions:
|
||||
pytestpm = get_config().pluginmanager # fully initialized with plugins
|
||||
saveindent = []
|
||||
|
||||
class api1:
|
||||
class api1(object):
|
||||
def pytest_plugin_registered(self):
|
||||
saveindent.append(pytestpm.trace.root.indent)
|
||||
|
||||
class api2:
|
||||
class api2(object):
|
||||
def pytest_plugin_registered(self):
|
||||
saveindent.append(pytestpm.trace.root.indent)
|
||||
raise ValueError()
|
||||
@@ -156,11 +156,11 @@ class TestPytestPluginInteractions:
|
||||
def test_warn_on_deprecated_multicall(self, pytestpm):
|
||||
warnings = []
|
||||
|
||||
class get_warnings:
|
||||
class get_warnings(object):
|
||||
def pytest_logwarning(self, message):
|
||||
warnings.append(message)
|
||||
|
||||
class Plugin:
|
||||
class Plugin(object):
|
||||
def pytest_configure(self, __multicall__):
|
||||
pass
|
||||
|
||||
@@ -173,11 +173,11 @@ class TestPytestPluginInteractions:
|
||||
def test_warn_on_deprecated_addhooks(self, pytestpm):
|
||||
warnings = []
|
||||
|
||||
class get_warnings:
|
||||
class get_warnings(object):
|
||||
def pytest_logwarning(self, code, fslocation, message, nodeid):
|
||||
warnings.append(message)
|
||||
|
||||
class Plugin:
|
||||
class Plugin(object):
|
||||
def pytest_testhook():
|
||||
pass
|
||||
|
||||
@@ -221,7 +221,7 @@ def test_importplugin_error_message(testdir, pytestpm):
|
||||
assert py.std.re.match(expected, str(excinfo.value))
|
||||
|
||||
|
||||
class TestPytestPluginManager:
|
||||
class TestPytestPluginManager(object):
|
||||
def test_register_imported_modules(self):
|
||||
pm = PytestPluginManager()
|
||||
mod = py.std.types.ModuleType("x.y.pytest_hello")
|
||||
@@ -348,7 +348,7 @@ class TestPytestPluginManager:
|
||||
pytestpm.consider_conftest(mod)
|
||||
|
||||
|
||||
class TestPytestPluginManagerBootstrapming:
|
||||
class TestPytestPluginManagerBootstrapming(object):
|
||||
def test_preparse_args(self, pytestpm):
|
||||
pytest.raises(ImportError, lambda:
|
||||
pytestpm.consider_preparse(["xyz", "-p", "hello123"]))
|
||||
|
||||
Reference in New Issue
Block a user