TestCase.{assert,fail}* methods (some are tested implicitly)
"""
+import sys
from test import test_support
import unittest
from unittest import TestCase
self.failIfAlmostEqual, 0, .1+.1j, places=0)
-class Test_TestProgram(TestCase):
-
- def testTestProgram_testRunnerArgument(self):
- program = object.__new__(unittest.TestProgram)
- program.parseArgs = lambda _: None
- program.runTests = lambda: None
- program.__init__(testRunner=None)
- self.assertEqual(program.testRunner, unittest.TextTestRunner)
-
######################################################################
## Main
def test_main():
test_support.run_unittest(Test_TestCase, Test_TestLoader,
Test_TestSuite, Test_TestResult, Test_FunctionTestCase,
- Test_Assertions, Test_TestProgram)
+ Test_Assertions)
if __name__ == "__main__":
test_main()
def __init__(self, module='__main__', defaultTest=None,
argv=None, testRunner=None,
testLoader=defaultTestLoader):
- if testRunner is None:
- testRunner = TextTestRunner
if type(module) == type(''):
self.module = __import__(module)
for part in module.split('.')[1:]:
self.module)
def runTests(self):
+ if self.testRunner is None:
+ self.testRunner = TextTestRunner
+
if isinstance(self.testRunner, (type, types.ClassType)):
try:
testRunner = self.testRunner(verbosity=self.verbosity)