unittest - sort cases to be run

Kevin Zhang kevin.misc.10 at gmail.com
Tue Aug 21 05:09:21 EDT 2012


Hi all,

I want to sort the order of the unittest cases to be run, but found such
statement in Python doc,
"Note that the order in which the various test cases will be run is
determined by sorting the test function names with respect to the built-in
ordering for strings."

    s.addTest(BTest())
    s.addTest(ATest())
    TextTestRunner().run(ts)

I need BTest() to be run prior to ATest(), is there any natural/beautiful
way to achieve this? Thanks,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120821/5433cfa3/attachment.html>


More information about the Python-list mailing list