class Directory(FSCollector):
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, fspath, parent=None):
*no docstring available*
arguments:
return value:
<None>
source: test/collect.py
|
def __init__(self, fspath, parent=None): |
fspath = py.path.local(fspath) |
super(FSCollector, self).__init__(fspath.basename, parent) |
self.fspath = fspath | |
def filefilter(self, path):
*no docstring available*
arguments:
return value:
AnyOf(<None>, <Boolean>)
source: test/collect.py
|
def filefilter(self, path): |
if path.check(file=1): |
b = path.purebasename |
ext = path.ext |
return (b.startswith('test_') or |
b.endswith('_test')) and ext in ('.txt', '.py') | |
def finishcapture(self):
*no docstring available*
arguments:
return value:
<None>
def join(self, name):
*no docstring available*
source: test/collect.py
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 | |
def join(self, name): |
name2items = self.__dict__.setdefault('_name2items', {}) |
try: |
res = name2items[name] |
except KeyError: |
p = self.fspath.join(name) |
res = None |
if p.check(file=1): |
if p.ext == '.py': |
res = self.Module(p, parent=self) |
elif p.ext == '.txt': |
res = self.DoctestFile(p, parent=self) |
elif p.check(dir=1): |
Directory = py.test.config.getvalue('Directory', p) |
res = Directory(p, parent=self) |
name2items[name] = res |
return res | |
def listchain(self):
return list of all parent collectors up to ourself.
arguments:
return value:
<List>
source: test/collect.py
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 | |
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 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 recfilter(self, path):
*no docstring available*
arguments:
return value:
AnyOf(<None>, <Boolean>)
source: test/collect.py
|
def recfilter(self, path): |
if path.check(dir=1, dotfile=0): |
return path.basename not in ('CVS', '_darcs', '{arch}') | |
def run(self):
*no docstring available*
arguments:
return value:
<List>
source: test/collect.py
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 | |
def run(self): |
files = [] |
dirs = [] |
for p in self.fspath.listdir(): |
if self.filefilter(p): |
files.append(p.basename) |
elif self.recfilter(p): |
dirs.append(p.basename) |
files.sort() |
dirs.sort() |
return files + dirs | |
def setup(self):
*no docstring available*
arguments:
return value:
<None>
def startcapture(self):
*no docstring available*
arguments:
return value:
<None>
def teardown(self):
*no docstring available*
arguments:
return value:
<None>
def __cmp__(self, other):
*no docstring available*
arguments:
- self: <UNKNOWN>
- other: <UNKNOWN>
return value:
<UNKNOWN>
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>