This is a basic tree configuration:<div><br></div><div><div>class TreeData(fixture.DataSet):</div><div><br></div><div>    class branch:</div><div>        tag = &#39;branch&#39;</div><div><br></div><div>    class leaf_one:</div>
<div>        tag = &#39;leaf_one&#39;</div><div>        owner = TreeData.branch</div><div><br></div><div>    class leaf_two:</div><div>        tag = &#39;leaf_two&#39;</div><div>        owner = TreeData.branch</div><div><br>
</div><div>Python doesn&#39;t like that because (unlike real languages) TreeData doesn&#39;t appear in the lookup namespace until it&#39;s fully defined.</div><div><br></div><div>The work-around is to build a different suite for each tier of the tree:</div>
<div><br></div><div><div>class TreeData(fixture.DataSet):</div><div>    class branch:</div><div>        tag = &#39;branch&#39;</div><div><br></div><div>class TreeLeafData(fixture.DataSet):</div><div>    class leaf_one:</div>
<div>        tag = &#39;leaf_one&#39;</div><div>        owner = TreeData.branch</div><div><br></div><div>    class leaf_two:</div><div>        tag = &#39;leaf_two&#39;</div><div>        owner = TreeData.branch</div><div><br>
</div></div><div>That&#39;s really tacky - is there a simpler fix?</div><div><br></div><div>(On a related note, how do I supply the tag=&#39;my name&#39; automatically, from the class name just above it?)</div><br>-- <br>
  Phlip<br>  <a href="http://c2.com/cgi/wiki?ZeekLand">http://c2.com/cgi/wiki?ZeekLand</a> <br>
</div>