slightly simplify collection node init
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user