@@ -325,7 +325,7 @@ def _build_closure(self,
325325 # ------ tools to add new fixture names during closure construction
326326
327327 def add_required_fixture (self , new_fixture_name , new_fixture_defs ):
328- """Add some required fixture names to this node. Returns True if new fixtures were added here (not in child) """
328+ """Add some required fixture names to all leaves under this node """
329329 if self .already_knows_fixture (new_fixture_name ):
330330 return
331331 elif not self .has_split ():
@@ -574,15 +574,17 @@ def __setitem__(self, i, o):
574574 def __delitem__ (self , i ):
575575 self .remove (self [i ])
576576
577- def insert (self , index , object ):
577+ def insert (self , index , fixture_name ):
578578 # if index == 0:
579- # print()
580- # elif index == len(self):
581- # print()
582- # else:
583- # raise ValueError("It is not possible to insert a fixture name in this closure")
584- raise NotImplementedError ("When fixture unions are present, inserting a fixture in the closure is non-trivial."
585- " Please report this so that we can find a suitable solution for your need." )
579+ # # prepend
580+ # self.tree.fixture_defs
581+ if index == len (self ):
582+ # append: supported
583+ self .tree .build_closure ((fixture_name ,))
584+ else :
585+ raise NotImplementedError ("When fixture unions are present, inserting a fixture in the closure is "
586+ "non-trivial. Please report this so that we can find a suitable solution for "
587+ "your need." )
586588
587589 def remove (self , value ):
588590 # try:
0 commit comments