help: Unit test fixture returning the same object

Roy Smith roy at panix.com
Wed Aug 4 18:58:55 CEST 2004


michael_mccracken at mac.com (Michael McCracken) wrote:
> So, I'm still surprised that id() would point to the same object every
> time, but I'm willing to believe it. However, I don't think that's the
> only thing that's going on - the reason I noticed this in the first
> place is that the setUp method was opening a file and populating some
> lists in my File object, and those lists were accumulating objects
> between test methods.

My first guess would be that you're using class variables instead of 
instance variables, but you say:

> I don't think I'm accidentally using class variables

so I'm stumped.  Can you post your code?



More information about the Python-list mailing list