[Python-Dev] Unit testing (again)

Jeremy Hylton jeremy@alum.mit.edu
Mon, 12 Feb 2001 18:16:19 -0500 (EST)


>>>>> "AMK" == Andrew Kuchling <akuchlin@cnri.reston.va.us> writes:

  AMK> On Mon, Feb 12, 2001 at 04:59:06PM -0500, Jeremy Hylton wrote:
  >> I'm happy to discuss on either venue, or to hash it in private
  >> email.  What specific features do you need?  Perhaps Steve will
  >> be interested in including them in PyUnit.

  AMK> * Useful shorthands for common asserts (testing that two
  AMK>   sequences are the same ignoring order, for example)

We can write a collection of helper functions for this, right?
    self.verify(sequenceElementsThatSame(l1, l2))

  AMK> * A way to write test cases that doesn't bring the test method
  AMK>   to a halt if something raises an unexpected exception

I'm not sure how to achieve this or why you would want the test to
continue.  I know that Quixote uses test cases in strings, but it's
the thing I like the least about Quixote unittest.  Can you think of
an alternate mechanism?

Maybe I'd be less opposed if I could understand why it's desirable to
continue executing a method where something has already failed
unexpectedly.  After the first exception, something is broken and
needs to be fixed, regardless of whether subsequent lines of code
work. 

  AMK> * Coverage support (though that would also entail Skip's
  AMK>   coverage code getting into 2.1)

Shouldn't be hard.  Skip's coverage code was in 2.0; we might need to
move it from Tools/script to the library, though.

Jeremy