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

Method assertRaisesMessage

Lib/test/test_fractions.py:305–313  ·  view source on GitHub ↗

Asserts that callable(*args, **kwargs) raises exc_type(message).

(self, exc_type, message,
                            callable, *args, **kwargs)

Source from the content-addressed store, hash-verified

303 self.assertListEqual(list(map(type, expected)), list(map(type, actual)))
304
305 def assertRaisesMessage(self, exc_type, message,
306 callable, *args, **kwargs):
307 """Asserts that callable(*args, **kwargs) raises exc_type(message)."""
308 try:
309 callable(*args, **kwargs)
310 except exc_type as e:
311 self.assertEqual(message, str(e))
312 else:
313 self.fail("%s not raised" % exc_type.__name__)
314
315 def testInit(self):
316 self.assertEqual((0, 1), _components(F()))

Callers 8

testInitMethod · 0.95
testFromStringMethod · 0.95
check_invalidMethod · 0.95
testFromFloatMethod · 0.95
testFromDecimalMethod · 0.95
testLimitDenominatorMethod · 0.95
test_complex_handlingMethod · 0.95

Calls 3

strFunction · 0.85
assertEqualMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected