MCPcopy Index your code
hub / github.com/python/cpython / test_init__no_test_name

Method test_init__no_test_name

Lib/test/test_unittest/test_case.py:88–103  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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 # ...

Callers

nothing calls this directly

Calls 7

assertEqualMethod · 0.95
assertRaisesMethod · 0.95
runMethod · 0.95
assertEndsWithMethod · 0.80
TestClass · 0.70
idMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected