slightly simplify collection node init

This commit is contained in:
holger krekel
2010-11-01 01:01:31 +01:00
parent c3ec2718a2
commit cf8dd64703
5 changed files with 13 additions and 8 deletions

View File

@@ -275,6 +275,7 @@ class TmpTestdir:
p.ensure("__init__.py")
return p
Collection = Collection
def getnode(self, config, arg):
collection = Collection(config)
return collection.getbyid(collection._normalizearg(arg))[0]

View File

@@ -324,7 +324,7 @@ class Node(object):
self.config = config or parent.config
#: the collection this node is part of.
self.collection = collection or getattr(parent, 'collection', None)
self.collection = collection or parent.collection
#: the file where this item is contained/collected from.
self.fspath = getattr(parent, 'fspath', None)