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

Method test_error_propagation

Lib/test/test_functools.py:171–177  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

169 self.assertTrue(args2 == (0,) and kw2 == {'a':1})
170
171 def test_error_propagation(self):
172 def f(x, y):
173 x / y
174 self.assertRaises(ZeroDivisionError, self.partial(f, 1, 0))
175 self.assertRaises(ZeroDivisionError, self.partial(f, 1), 0)
176 self.assertRaises(ZeroDivisionError, self.partial(f), 1, 0)
177 self.assertRaises(ZeroDivisionError, self.partial(f, y=0), 1)
178
179 def test_weakref(self):
180 f = self.partial(int, base=16)

Callers

nothing calls this directly

Calls 2

partialMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected