help with unittest

D

Danny Shevitz

Why doesn't the following code snippet work?

The error is

ImportError: No module named myTestCase2

TIA,
Danny

%<--------------------------------------------------------------------

# import the unittest module
import unittest

# create the first testcase
class myTestCase(unittest.TestCase):

def testTrue(self):
self.assertEqual(1,1)

# create the first testcase
class myTestCase2(unittest.TestCase):

def testTrue(self):
self.assertEqual(1,1)


if __name__ == '__main__':
#unittest.main()
suite =
unittest.defaultTestLoader.loadTestsFromNames(['myTestCase2.testTrue'])
unittest.TextTestRunner().run(suite)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top