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

Method test_attributes

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

Source from the content-addressed store, hash-verified

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)
89 # attributes should be readable
90 self.assertEqual(p.func, capture)
91 self.assertEqual(p.args, (1, 2))
92 self.assertEqual(p.keywords, dict(a=10, b=20))
93
94 def test_argument_checking(self):
95 self.assertRaises(TypeError, self.partial) # need at least a func arg

Callers

nothing calls this directly

Calls 2

partialMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected