File tree 1 file changed +14
-0
lines changed 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,20 @@ def _imply_path(
127
127
128
128
129
129
class NodeMeta (type ):
130
+ """Metaclass used by :class:`Node` to enforce that direct construction raises
131
+ :class:`Failed`.
132
+
133
+ This behaviour supports the indirection introduced with :meth:`Node.from_parent`,
134
+ the named constructor to be used instead of direct construction. The design
135
+ decision to enforce indirection with :class:`NodeMeta` was made as a
136
+ temporary aid for refactoring the collection tree, which was diagnosed to
137
+ have :class:`Node` objects whose creational patterns were overly entangled.
138
+ Once the refactoring is complete, this metaclass can be removed.
139
+
140
+ See https://github.com/pytest-dev/pytest/projects/3 for an overview of the
141
+ progress on detangling the :class:`Node` classes.
142
+ """
143
+
130
144
def __call__ (self , * k , ** kw ):
131
145
msg = (
132
146
"Direct construction of {name} has been deprecated, please use {name}.from_parent.\n "
You can’t perform that action at this time.
0 commit comments