class Generator(FunctionMixin, PyCollectorMixin, test.collect.Collector):
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=None):
*no docstring available*
arguments:
return value:
<None>
source: test/collect.py
|
def __init__(self, name, parent=None): |
self.name = name |
self.parent = parent |
self._config = getattr(parent, '_config', py.test.config) |
self.fspath = getattr(parent, 'fspath', None) | |
def classnamefilter(self, name):
*no docstring available*
arguments:
- self: <UNKNOWN>
- name: <UNKNOWN>
return value:
<UNKNOWN>
def finishcapture(self):
*no docstring available*
arguments:
return value:
<None>
def funcnamefilter(self, name):
*no docstring available*
arguments:
- self: <UNKNOWN>
- name: <UNKNOWN>
return value:
<UNKNOWN>
def getcallargs(self, obj):
*no docstring available*
arguments:
- self: <Instance of Class Generator>
- obj: AnyOf(<Method>, <None>, <Function>, <Tuple>)
return value:
<Tuple>
source: test/collect.py
|
def getcallargs(self, obj): |
if isinstance(obj, (tuple, list)): |
call, args = obj[0], obj[1:] |
else: |
call, args = obj, () |
return call, args | |
def join(self, 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:
<UNKNOWN>
def makeitem(self, name, obj, usefilters=True):
*no docstring available*
arguments:
- self: <UNKNOWN>
- name: <UNKNOWN>
- obj: <UNKNOWN>
- usefilters: <UNKNOWN>
return value:
<UNKNOWN>
source: test/collect.py
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 | |
def makeitem(self, name, obj, usefilters=True): |
if (not usefilters or self.classnamefilter(name)) and \ |
py.std.inspect.isclass(obj): |
return self.Class(name, parent=self) |
elif (not usefilters or self.funcnamefilter(name)) and callable(obj): |
if obj.func_code.co_flags & 32: |
return self.Generator(name, parent=self) |
else: |
return self.Function(name, parent=self) | |
def multijoin(self, namelist):
return a list of colitems for the given namelist.
arguments:
return value:
<List>
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):
*no docstring available*
arguments:
return value:
AnyOf(<List>, <None>)
source: test/collect.py
|
def run(self): |
self._prepare() |
itemlist = self._name2items |
return [itemlist["[%d]" % num].name for num in xrange(len(itemlist))] | |
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:
<UNKNOWN>
def __ne__(self, other):
*no docstring available*
arguments:
- self: <UNKNOWN>
- other: <UNKNOWN>
return value:
<UNKNOWN>
def __repr__(self):
*no docstring available*
arguments:
return value:
<UNKNOWN>