some pep8 fixes

This commit is contained in:
holger krekel 2010-11-13 23:33:50 +01:00
parent 0323c5247f
commit a298cf753d
4 changed files with 8 additions and 8 deletions

View File

@ -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))
)

View File

@ -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

View File

@ -1,4 +1,4 @@
import py
import pytest, py
mydir = py.path.local(__file__).dirpath()
def pytest_runtest_setup(item):

View File

@ -57,6 +57,6 @@ commands=
[pytest]
minversion=2.0
plugins=pytester
addopts=-rfx --pyargs
#addopts= -rxf --pyargs
rsyncdirs=tox.ini pytest.py _pytest testing