diff --git a/_pytest/helpconfig.py b/_pytest/helpconfig.py index ee1c3f5f7..76fb5553f 100644 --- a/_pytest/helpconfig.py +++ b/_pytest/helpconfig.py @@ -129,7 +129,7 @@ def pytest_plugin_registered(manager, plugin): # print "matching hook:", formatdef(method) if fail: name = getattr(plugin, '__name__', plugin) - raise PluginValidationError("%s:\n%s" %(name, stringio.getvalue())) + raise PluginValidationError("%s:\n%s" % (name, stringio.getvalue())) class PluginValidationError(Exception): """ plugin failed validation. """ @@ -151,7 +151,7 @@ def collectattr(obj): return methods def formatdef(func): - return "%s%s" %( + return "%s%s" % ( func.__name__, inspect.formatargspec(*inspect.getargspec(func)) ) diff --git a/_pytest/standalonetemplate.py b/_pytest/standalonetemplate.py index f3f2c5b3f..5aaceaa9e 100755 --- a/_pytest/standalonetemplate.py +++ b/_pytest/standalonetemplate.py @@ -15,7 +15,7 @@ class DictImporter(object): def find_module(self, fullname, path=None): if fullname in self.sources: return self - if fullname+'.__init__' in self.sources: + if fullname + '.__init__' in self.sources: return self return None @@ -26,7 +26,7 @@ class DictImporter(object): s = self.sources[fullname] is_pkg = False except KeyError: - s = self.sources[fullname+'.__init__'] + s = self.sources[fullname + '.__init__'] is_pkg = True co = compile(s, fullname, 'exec') @@ -42,11 +42,11 @@ class DictImporter(object): def get_source(self, name): res = self.sources.get(name) if res is None: - res = self.sources.get(name+'.__init__') + res = self.sources.get(name + '.__init__') return res if __name__ == "__main__": - if sys.version_info >= (3,0): + if sys.version_info >= (3, 0): exec("def do_exec(co, loc): exec(co, loc)\n") import pickle sources = sources.encode("ascii") # ensure bytes diff --git a/example/assertion/global_testmodule_config/conftest.py b/example/assertion/global_testmodule_config/conftest.py index 293cbea3c..c7bb60aa1 100644 --- a/example/assertion/global_testmodule_config/conftest.py +++ b/example/assertion/global_testmodule_config/conftest.py @@ -1,4 +1,4 @@ -import py +import pytest, py mydir = py.path.local(__file__).dirpath() def pytest_runtest_setup(item): diff --git a/tox.ini b/tox.ini index 37b4583c9..941bd9c86 100644 --- a/tox.ini +++ b/tox.ini @@ -57,6 +57,6 @@ commands= [pytest] minversion=2.0 plugins=pytester -addopts=-rfx --pyargs +#addopts= -rxf --pyargs rsyncdirs=tox.ini pytest.py _pytest testing