[svn r37885] adding docstrings, stripping non-used names from import
--HG-- branch : trunk
This commit is contained in:
parent
309f3e2cec
commit
ee40787bf1
|
@ -25,7 +25,7 @@ The is a schematic example of a tree of collectors and test items::
|
||||||
"""
|
"""
|
||||||
from __future__ import generators
|
from __future__ import generators
|
||||||
import py
|
import py
|
||||||
from py.__.test.outcome import Skipped, Failed, Passed
|
from py.__.test.outcome import Skipped
|
||||||
|
|
||||||
def configproperty(name):
|
def configproperty(name):
|
||||||
def fget(self):
|
def fget(self):
|
||||||
|
|
|
@ -67,16 +67,16 @@ class Function(Item):
|
||||||
return self._sort_value
|
return self._sort_value
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
""" setup and execute the underlying test function. """
|
||||||
self._state.prepare(self)
|
self._state.prepare(self)
|
||||||
self.execute(self.obj, *self._args)
|
self.execute(self.obj, *self._args)
|
||||||
|
|
||||||
def execute(self, target, *args):
|
def execute(self, target, *args):
|
||||||
""" default implementation for calling a test target is to
|
""" execute the given test function. """
|
||||||
simply call it.
|
|
||||||
"""
|
|
||||||
target(*args)
|
target(*args)
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
|
""" perform setup for this test function. """
|
||||||
if getattr(self.obj, 'im_self', None):
|
if getattr(self.obj, 'im_self', None):
|
||||||
name = 'setup_method'
|
name = 'setup_method'
|
||||||
else:
|
else:
|
||||||
|
@ -87,6 +87,7 @@ class Function(Item):
|
||||||
return meth(self.obj)
|
return meth(self.obj)
|
||||||
|
|
||||||
def teardown(self):
|
def teardown(self):
|
||||||
|
""" perform teardown for this test function. """
|
||||||
if getattr(self.obj, 'im_self', None):
|
if getattr(self.obj, 'im_self', None):
|
||||||
name = 'teardown_method'
|
name = 'teardown_method'
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue