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

Method test_cmp_to_signature

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

Source from the content-addressed store, hash-verified

1236 @unittest.skipIf(support.MISSING_C_DOCSTRINGS,
1237 "Signature information for builtins requires docstrings")
1238 def test_cmp_to_signature(self):
1239 sig = Signature.from_callable(self.cmp_to_key)
1240 self.assertEqual(str(sig), '(mycmp)')
1241 def mycmp(x, y):
1242 return y - x
1243 sig = Signature.from_callable(self.cmp_to_key(mycmp))
1244 self.assertEqual(str(sig), '(obj)')
1245
1246
1247

Callers

nothing calls this directly

Calls 3

strFunction · 0.85
from_callableMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected