Ben Finney  <[EMAIL PROTECTED]> wrote:
>"Giampaolo Rodola'" <[EMAIL PROTECTED]> writes:
>> Is there a way to force unittest to run test methods in the order
>> they appear?

> No, and this is a good thing.

> Your test cases should *not* depend on any state from other test
> cases; they should function equally well when executed in any
> arbitrary sequence. Dependencies between separate test cases (e.g.
> "they only work correctly when run in a specific sequence") means
> you're not isolating them properly.


So a mode to randomise the test sequence would be nice to have.

Unittest's behaviour (using alphabetical order) doesn't really help to
detect undesired dependencies (which might be bugs in the test suite or
bugs in the underlying code).

But running tests in the order they appear is often helpful: you can
put the tests for basic stuff before the tests for advanced stuff, and
then if you suddenly get seventeen failing tests, you know that the
first failure is the best bet to investigate first.

-M-

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to