Back to index

python3.2  3.2.2
Public Member Functions
unittest.test.test_result.Test_OldTestResult Class Reference

List of all members.

Public Member Functions

def assertOldResultWarning
def testOldTestResult
def testOldTestTesultSetup
def testOldTestResultClass
def testOldResultWithRunner

Detailed Description

Definition at line 313 of file test_result.py.


Member Function Documentation

Definition at line 315 of file test_result.py.

00315 
00316     def assertOldResultWarning(self, test, failures):
00317         with support.check_warnings(("TestResult has no add.+ method,",
00318                                      RuntimeWarning)):
00319             result = OldResult()
00320             test.run(result)
00321             self.assertEqual(len(result.failures), failures)

Here is the call graph for this function:

Definition at line 354 of file test_result.py.

00354 
00355     def testOldResultWithRunner(self):
00356         class Test(unittest.TestCase):
00357             def testFoo(self):
00358                 pass
00359         runner = unittest.TextTestRunner(resultclass=OldResult,
00360                                           stream=io.StringIO())
00361         # This will raise an exception if TextTestRunner can't handle old
00362         # test result objects
00363         runner.run(Test('testFoo'))
00364 

Definition at line 322 of file test_result.py.

00322 
00323     def testOldTestResult(self):
00324         class Test(unittest.TestCase):
00325             def testSkip(self):
00326                 self.skipTest('foobar')
00327             @unittest.expectedFailure
00328             def testExpectedFail(self):
00329                 raise TypeError
00330             @unittest.expectedFailure
00331             def testUnexpectedSuccess(self):
00332                 pass
00333 
00334         for test_name, should_pass in (('testSkip', True),
00335                                        ('testExpectedFail', True),
00336                                        ('testUnexpectedSuccess', False)):
00337             test = Test(test_name)
00338             self.assertOldResultWarning(test, int(not should_pass))

Here is the call graph for this function:

Definition at line 347 of file test_result.py.

00347 
00348     def testOldTestResultClass(self):
00349         @unittest.skip('no reason')
00350         class Test(unittest.TestCase):
00351             def testFoo(self):
00352                 pass
00353         self.assertOldResultWarning(Test('testFoo'), 0)

Definition at line 339 of file test_result.py.

00339 
00340     def testOldTestTesultSetup(self):
00341         class Test(unittest.TestCase):
00342             def setUp(self):
00343                 self.skipTest('no reason')
00344             def testFoo(self):
00345                 pass
00346         self.assertOldResultWarning(Test('testFoo'), 0)

Here is the call graph for this function:


The documentation for this class was generated from the following file: