Getting Unit Tests to work with Komodo IDE for Python

Posted by devoured elysium on Stack Overflow See other posts from Stack Overflow or by devoured elysium
Published on 2010-05-20T00:23:56Z Indexed on 2010/05/20 0:30 UTC
Read the original article Hit count: 283

Filed under:
|
|
|

I've tried to run the following code on Komodo IDE (for python):

import unittest

class MathLibraryTests(unittest.TestCase):
    def test1Plus1Equals2(self):
        self.assertEqual(1+1, 2)

Then, I created a new test plan, pointing to this project(file) directory and tried to run it the test plan. It seems to run but it doesn't seem to find any tests.

If I try to run the following code with the "regular" run command (F7)

class MathLibraryTests(unittest.TestCase):
    def testPlus1Equals2(self):
        self.assertEqual(1+1, 2)

if __name__ == "__main__":
    unittest.main()

it works. I get the following output:

----------------------------------------------------------------------
Ran 1 test in 0.000s

OK

What might I be doing wrong?

© Stack Overflow or respective owner

Related posts about unit-testing

Related posts about python