remove/refine some doc strings. create popen-files with absolute paths.

--HG--
branch : trunk
This commit is contained in:
holger krekel 2010-01-01 23:05:00 +01:00
parent e0dd171e45
commit fd76cd8f41
3 changed files with 9 additions and 36 deletions

View File

@ -1,6 +1,5 @@
""" """
base test collection objects. base test collection objects. Collectors and test Items form a tree
Collectors and test Items form a tree
that is usually built iteratively. that is usually built iteratively.
""" """
import py import py
@ -24,17 +23,8 @@ class HookProxy:
return call_matching_hooks return call_matching_hooks
class Node(object): class Node(object):
""" base class for Nodes in the collection tree. """ base class for all Nodes in the collection tree.
Collector nodes have children and Collector subclasses have children, Items are terminal nodes.
Item nodes are terminal.
All nodes of the collection tree carry a _config
attribute for these reasons:
- to access custom Collection Nodes from a project
(defined in conftest's)
- to pickle themselves relatively to the "topdir"
- configuration/options for setup/teardown
stdout/stderr capturing and execution of test items
""" """
def __init__(self, name, parent=None, config=None): def __init__(self, name, parent=None, config=None):
self.name = name self.name = name
@ -262,12 +252,10 @@ class Node(object):
return col._getitembynames(names) return col._getitembynames(names)
_fromtrail = staticmethod(_fromtrail) _fromtrail = staticmethod(_fromtrail)
def _repr_failure_py(self, excinfo, outerr=None): def _repr_failure_py(self, excinfo):
assert outerr is None, "XXX deprecated"
excinfo.traceback = self._prunetraceback(excinfo.traceback) excinfo.traceback = self._prunetraceback(excinfo.traceback)
# XXX temporary hack: getrepr() should not take a 'style' argument # XXX should excinfo.getrepr record all data and toterminal()
# at all; it should record all data in all cases, and the style # process it?
# should be parametrized in toterminal().
if self.config.option.tbstyle == "short": if self.config.option.tbstyle == "short":
style = "short" style = "short"
else: else:

View File

@ -1,20 +1,5 @@
""" """
Python related collection nodes. Here is an example of Python related collection nodes.
a tree of collectors and test items that this modules provides::
Module # File
Class
Instance
Function
Generator
...
Function
Generator
Function
DoctestFile # File
DoctestFileContent # acts as Item
""" """
import py import py
import inspect import inspect

View File

@ -284,8 +284,8 @@ class TmpTestdir:
def _run(self, *cmdargs): def _run(self, *cmdargs):
cmdargs = [str(x) for x in cmdargs] cmdargs = [str(x) for x in cmdargs]
p1 = py.path.local("stdout") p1 = self.tmpdir.join("stdout")
p2 = py.path.local("stderr") p2 = self.tmpdir.join("stderr")
print_("running", cmdargs, "curdir=", py.path.local()) print_("running", cmdargs, "curdir=", py.path.local())
f1 = p1.open("w") f1 = p1.open("w")
f2 = p2.open("w") f2 = p2.open("w")