a Function Item is responsible for setting up
and executing a Python callable test object.
class attributes and properties:
Class: <property object (dynamically calculated value)>
Directory: <property object (dynamically calculated value)>
DoctestFile: <property object (dynamically calculated value)>
Function: <property object (dynamically calculated value)>
Generator: <property object (dynamically calculated value)>
Instance: <property object (dynamically calculated value)>
Module: <property object (dynamically calculated value)>
obj: <property object (dynamically calculated value)>
methods:
def __init__(self, name, parent, args=(), obj=<object object at 0x2ae9ee381080>, sort_value=None):
*no docstring available*
arguments:
- self: <Instance of AnyOf(Class Function, Class CheckLink, Class CheckLink, Class Function, Class MyFunction)>
- name: <String>
- parent: <Instance of AnyOf(Class LinkCheckerMaker, Class Instance, Class Module, Class Instance, Class Generator, Class Module, Class LinkCheckerMaker)>
- args: <Tuple>
- obj: AnyOf(<Instance of Class object>, <Function>, <Method>)
- sort_value: AnyOf(<Int>, <None>)
return value:
<None>
source: test/item.py
|
def __init__(self, name, parent, args=(), obj=_dummy, sort_value = None): |
super(Function, self).__init__(name, parent) |
self._args = args |
if obj is not _dummy: |
self._obj = obj |
self._sort_value = sort_value | |
def execute(self, target, *args):
execute the given test function.
arguments:
- self: <Instance of Class Function>
- target: AnyOf(<Function>, <Method>)
return value:
<None>
source: test/item.py
|
def execute(self, target, *args): |
""" execute the given test function. """ |
target(*args) | |
def finishcapture(self):
*no docstring available*
arguments:
return value:
<None>
def join(self, name):
return a child item for the given name. Usually the
session feeds the join method with each name obtained
from ``colitem.run()``. If the return value is None
it means the ``colitem`` was not able to resolve
with the given name.
arguments:
- self: <UNKNOWN>
- name: <UNKNOWN>
return value:
<UNKNOWN>
source: test/collect.py
|
def join(self, name): |
""" return a child item for the given name. Usually the |
session feeds the join method with each name obtained |
from ``colitem.run()``. If the return value is None |
it means the ``colitem`` was not able to resolve |
with the given name. |
""" | |
def listchain(self):
return list of all parent collectors up to ourself.
arguments:
return value:
<List>
source: test/collect.py
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 | |
def listchain(self): |
""" return list of all parent collectors up to ourself. """ |
l = [self] |
while 1: |
x = l[-1] |
if x.parent is not None: |
l.append(x.parent) |
else: |
l.reverse() |
return l | |
def listnames(self):
*no docstring available*
arguments:
return value:
<List>
def multijoin(self, namelist):
return a list of colitems for the given namelist.
arguments:
- self: <UNKNOWN>
- namelist: <UNKNOWN>
return value:
<UNKNOWN>
source: test/collect.py
|
def multijoin(self, namelist): |
""" return a list of colitems for the given namelist. """ |
return [self.join(name) for name in namelist] | |
def run(self):
setup and execute the underlying test function.
arguments:
return value:
<None>
source: test/item.py
|
def run(self): |
""" setup and execute the underlying test function. """ |
self._state.prepare(self) |
self.execute(self.obj, *self._args) | |
def setup(self):
perform setup for this test function.
arguments:
return value:
<None>
source: test/collect.py
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 | |
def setup(self): |
""" perform setup for this test function. """ |
if getattr(self.obj, 'im_self', None): |
name = 'setup_method' |
else: |
name = 'setup_function' |
obj = self.parent.obj |
meth = getattr(obj, name, None) |
if meth is not None: |
return meth(self.obj) | |
def startcapture(self):
*no docstring available*
arguments:
return value:
<None>
def teardown(self):
perform teardown for this test function.
arguments:
return value:
<None>
source: test/collect.py
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 | |
def teardown(self): |
""" perform teardown for this test function. """ |
if getattr(self.obj, 'im_self', None): |
name = 'teardown_method' |
else: |
name = 'teardown_function' |
obj = self.parent.obj |
meth = getattr(obj, name, None) |
if meth is not None: |
return meth(self.obj) | |
def __cmp__(self, other):
*no docstring available*
arguments:
return value:
<Int>
source: test/collect.py
|
def __cmp__(self, other): |
s1 = self._getsortvalue() |
s2 = other._getsortvalue() |
|
return cmp(s1, s2) | |
def __eq__(self, other):
*no docstring available*
arguments:
return value:
<Boolean>
def __hash__(self):
*no docstring available*
arguments:
return value:
<Int>
def __ne__(self, other):
*no docstring available*
arguments:
return value:
<Boolean>
def __repr__(self):
*no docstring available*
arguments:
return value:
<String>