Standard idiom for testing individual functions?

Jeremy Fincher tweedgeezer at hotmail.com
Wed Aug 7 15:33:05 EDT 2002


I've read in some other threads that if any of the methods of a
TestCase fail, the entire TestCase fails -- is that still true?  If
so, if test_foo below failed, would that possibly prevent test_bar
from even running? (or vice versa, of course).

Thanks,
Jeremy

> class TestMyStuff(unittest.TestCase):
> 
>   def test_foo(self):
>     f = foo()
>     self.failUnless(f is None)
> 
>   def test_bar(self):
>     b = bar()
>     self.failUnless(b is None)
> 
> if __name__ == "__main__":
>   unittest.main()



More information about the Python-list mailing list