"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.

Use the TestCase.setUp and TestCase.tearDown methods to handle any
fixtures needed by test cases in each class of test cases. That way,
the fixtures will be set up and torn down between every test case.
Find out about test fixtures in the documentation for unittest
<URLhttp://www.python.org/doc/lib/module-unittest>.

-- 
 \     "All my life I've had one dream: to achieve my many goals."  -- |
  `\                                             Homer, _The Simpsons_ |
_o__)                                                                  |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to