back out accidental changes introduced by last patch

This commit is contained in:
holger krekel 2012-09-25 15:13:58 +02:00
parent a1c3d60747
commit a18fd61a20
1 changed files with 3 additions and 8 deletions

View File

@ -19,10 +19,8 @@ class FactoryMarker:
return function return function
class SetupMarker: class SetupMarker:
def __init__(self, scope, enabled): def __init__(self, scope):
self.scope = scope self.scope = scope
self.enabled = enabled
def __call__(self, function): def __call__(self, function):
function._pytestsetup = self function._pytestsetup = self
return function return function
@ -38,17 +36,14 @@ def factory(scope=None, params=None):
""" """
return FactoryMarker(scope, params) return FactoryMarker(scope, params)
def setup(scope="function", enabled=None): def setup(scope="function"):
""" return a decorator to mark functions as setup functions. """ return a decorator to mark functions as setup functions.
:arg scope: the scope for which the setup function will be active, one :arg scope: the scope for which the setup function will be active, one
of "function", "class", "module", "session". of "function", "class", "module", "session".
Defaults to "function". Defaults to "function".
:arg enabled: if a callable is specified, enabled(node) will be called
and if it returns a false value this setup function
will not be called and its funcargs will not be setup.
""" """
return SetupMarker(scope, enabled) return SetupMarker(scope)
def cached_property(f): def cached_property(f):
"""returns a cached property that is calculated by function f. """returns a cached property that is calculated by function f.