A Nose plugin to specify the order of unit test execution

前端 未结 2 983
时光取名叫无心
时光取名叫无心 2020-12-17 10:58

I have a desire to use Nose for an over the wire integration test suite. However, the order of execution of some of these tests is important.

That said, I thought I

2条回答
  •  隐瞒了意图╮
    2020-12-17 11:11

    From the documentation:

    [...] nose runs functional tests in the order in which they appear in the module file. TestCase-derived tests and other test classes are run in alphabetical order.

    So a simple solution might be to rename the tests in your test case:

    class Foo(unittest.TestCase):
    
        def test_01_foo(self):
            pass
    
        def test_02_boo(self):
            pass
    

提交回复
热议问题