Python doesn't detect my unittest
Question: I have following code snippet -

    
    
    import unittest
    
    class SimpleWidgetTestCase(unittest.TestCase):
        def setUp(self):
            print 'setup'
        def method_test(self):
            print 'test method'
        def tearDown(self):
            print 'tear down'
    
    if __name__ == "__main__":
        unittest.main()
    

Output -

    
    
    ----------------------------------------------------------------------
    Ran 0 tests in 0.000s
    
    OK
    


Answer: test method name should start with `test`. Replace `method_test` to
`test_method`, and try again.

From [unittest
documentation](http://docs.python.org/2/library/unittest.html#basic-example):

> A testcase is created by subclassing unittest.TestCase. The three individual
> tests are defined with methods whose names start with the letters test. This
> naming convention informs the test runner about which methods represent
> tests.

