some more finalization of docs

This commit is contained in:
holger krekel
2012-10-19 10:07:11 +02:00
parent 5e28f461c8
commit 024df6e00b
9 changed files with 1188 additions and 55 deletions

View File

@@ -10,6 +10,8 @@ from py._code.code import TerminalRepr
import _pytest
cutdir = py.path.local(_pytest.__file__).dirpath()
callable = py.builtin.callable
class FixtureFunctionMarker:
def __init__(self, scope, params, autouse=False):
self.scope = scope
@@ -45,7 +47,7 @@ def fixture(scope="function", params=None, autouse=False):
can see it. If False (the default) then an explicit
reference is needed to activate the fixture.
"""
if py.builtin.callable(scope) and params is None and autouse == False:
if callable(scope) and params is None and autouse == False:
# direct decoration
return FixtureFunctionMarker("function", params, autouse)(scope)
else:
@@ -474,7 +476,7 @@ class Generator(FunctionMixin, PyCollector):
seen = {}
for i, x in enumerate(self.obj()):
name, call, args = self.getcallargs(x)
if not py.builtin.callable(call):
if not callable(call):
raise TypeError("%r yielded non callable test %r" %(self.obj, call,))
if name is None:
name = "[%d]" % i