(self)
| 86 | # Make sure it really is optional, and that it defaults to the proper |
| 87 | # thing. |
| 88 | def test_init__no_test_name(self): |
| 89 | class Test(unittest.TestCase): |
| 90 | def runTest(self): raise MyException() |
| 91 | def test(self): pass |
| 92 | |
| 93 | self.assertEndsWith(Test().id(), '.Test.runTest') |
| 94 | |
| 95 | # test that TestCase can be instantiated with no args |
| 96 | # primarily for use at the interactive interpreter |
| 97 | test = unittest.TestCase() |
| 98 | test.assertEqual(3, 3) |
| 99 | with test.assertRaises(test.failureException): |
| 100 | test.assertEqual(3, 2) |
| 101 | |
| 102 | with self.assertRaises(AttributeError): |
| 103 | test.run() |
| 104 | |
| 105 | # "class TestCase([methodName])" |
| 106 | # ... |
nothing calls this directly
no test coverage detected