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

Method test_basic_examples

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

Source from the content-addressed store, hash-verified

77class TestPartial:
78
79 def test_basic_examples(self):
80 p = self.partial(capture, 1, 2, a=10, b=20)
81 self.assertTrue(callable(p))
82 self.assertEqual(p(3, 4, b=30, c=40),
83 ((1, 2, 3, 4), dict(a=10, b=30, c=40)))
84 p = self.partial(map, lambda x: x*10)
85 self.assertEqual(list(p([1,2,3,4])), [10, 20, 30, 40])
86
87 def test_attributes(self):
88 p = self.partial(capture, 1, 2, a=10, b=20)

Callers

nothing calls this directly

Calls 5

listClass · 0.85
partialMethod · 0.80
assertTrueMethod · 0.80
pFunction · 0.50
assertEqualMethod · 0.45

Tested by

no test coverage detected