Python unittest: TestSuite running only first TestCase
Question: Running `first_TestCase` and `second_TestCase` separately all works fine. But
when i created TestSuite, it runs only `first_TestCase`. Why is this
happening?

    
    
    import unittest
    from first_TestCase import first_TestCase
    from second_TestCase import second_TestCase
    
    
         def suite():
             suite = unittest.TestSuite()
             suite.addTest(first_TestCase())
             suite.addTest(second_TestCase())
             return suite
    
    if __name__ == "__main__":
         suite = unittest.defaultTestLoader.loadTestsFromTestCase(first_TestCase)
         unittest.TextTestRunner().run(suite)
    


Answer: You're saying:

    
    
    if __name__ == "__main__":
        suite = unittest.defaultTestLoader.loadTestsFromTestCase(first_TestCase)
        unittest.TextTestRunner().run(suite)
    

You're loading tests from only `first_TestCase` right before you run via the
`TextTestRunner`. You're never hitting that suite() function.

You should do:

    
    
    if __name__ == "__main__":
        unittest.TextTestRunner().run(suite())
    

Because you're not calling the suite() function in your current
implementation.

