MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_patma_249

Method test_patma_249

Lib/test/test_patma.py:2677–2689  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2675 self.assertEqual(y, 'bar')
2676
2677 def test_patma_249(self):
2678 class C:
2679 __attr = "eggs" # mangled to _C__attr
2680 _Outer__attr = "bacon"
2681 class Outer:
2682 def f(self, x):
2683 match x:
2684 # looks up __attr, not _C__attr or _Outer__attr
2685 case C(__attr=y):
2686 return y
2687 c = C()
2688 setattr(c, "__attr", "spam") # setattr is needed because we're in a class scope
2689 self.assertEqual(Outer().f(c), "spam")
2690
2691 def test_patma_250(self):
2692 def f(x):

Callers

nothing calls this directly

Calls 5

setattrFunction · 0.85
CClass · 0.70
OuterClass · 0.70
assertEqualMethod · 0.45
fMethod · 0.45

Tested by

no test coverage detected