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

Method test_false_meta

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

Source from the content-addressed store, hash-verified

2518 self.assertEqual(mro(X, abcs=many_abcs), expected)
2519
2520 def test_false_meta(self):
2521 # see issue23572
2522 class MetaA(type):
2523 def __len__(self):
2524 return 0
2525 class A(metaclass=MetaA):
2526 pass
2527 class AA(A):
2528 pass
2529 @functools.singledispatch
2530 def fun(a):
2531 return 'base A'
2532 @fun.register(A)
2533 def _(a):
2534 return 'fun A'
2535 aa = AA()
2536 self.assertEqual(fun(aa), 'fun A')
2537
2538 def test_mro_conflicts(self):
2539 c = collections.abc

Callers

nothing calls this directly

Calls 3

AAClass · 0.85
funFunction · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected