How to have unittest tests to be executed in the order they appear?

Giampaolo Rodola' gnewsg at gmail.com
Tue Apr 15 21:02:48 CEST 2008


Hi there.
Is there a way to force unittest to run test methods in the order they
appear?
I'll try to explain.
My test suite appears as something like this:

import unittest
from test.test_support import TestSkipped, run_unittest

class TestCase(unittest.TestCase):

    def test_z(self):
         ...

    def test_b(self):
         ...

    def test_d(self):
         ...

if __name__ == '__main__':
     run_unittest(TestCase)


I'd like the tests to be executed in the order they are defined
(test_z, test_b and finally test_d).
Is there a way to do that?

Thanks in advance.


--- Giampaolo
http://code.google.com/p/pyftpdlib/



More information about the Python-list mailing list