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

Method test_assignment_behavior

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

Source from the content-addressed store, hash-verified

2896 self.assertEqual(a.t(0.0), 0.0)
2897
2898 def test_assignment_behavior(self):
2899 # see gh-106448
2900 class A:
2901 @functools.singledispatchmethod
2902 def t(arg):
2903 return arg
2904
2905 a = A()
2906 a.t.foo = 'bar'
2907 a2 = A()
2908 with self.assertRaises(AttributeError):
2909 a2.t.foo
2910
2911 def test_classmethod_register(self):
2912 class A:

Callers

nothing calls this directly

Calls 2

AClass · 0.70
assertRaisesMethod · 0.45

Tested by

no test coverage detected