ValueError: no such test method in : runTest

后端 未结 6 1080
时光取名叫无心
时光取名叫无心 2020-12-03 03:10

I have a test case:

class LoginTestCase(unittest.TestCase):
    ...

I\'d like to use it in a different test case:

class Edi         


        
6条回答
  •  既然无缘
    2020-12-03 03:50

    Here's some 'deep black magic':

    suite = unittest.TestLoader().loadTestsFromTestCase(Test_MyTests)
    unittest.TextTestRunner(verbosity=3).run(suite)
    

    Very handy if you just want to test run your unit tests from a shell (i.e., IPython).

提交回复
热议问题