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)
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)