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

Function test

Doc/includes/mp_newtype.py:51–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49##
50
51def test():
52 manager = MyManager()
53 manager.start()
54
55 print('-' * 20)
56
57 f1 = manager.Foo1()
58 f1.f()
59 f1.g()
60 assert not hasattr(f1, '_h')
61 assert sorted(f1._exposed_) == sorted(['f', 'g'])
62
63 print('-' * 20)
64
65 f2 = manager.Foo2()
66 f2.g()
67 f2._h()
68 assert not hasattr(f2, 'f')
69 assert sorted(f2._exposed_) == sorted(['g', '_h'])
70
71 print('-' * 20)
72
73 it = manager.baz()
74 for i in it:
75 print('<%d>' % i, end=' ')
76 print()
77
78 print('-' * 20)
79
80 op = manager.operator()
81 print('op.add(23, 45) =', op.add(23, 45))
82 print('op.pow(2, 94) =', op.pow(2, 94))
83 print('op._exposed_ =', op._exposed_)
84
85##
86

Callers 1

mp_newtype.pyFile · 0.70

Calls 7

MyManagerClass · 0.70
startMethod · 0.45
fMethod · 0.45
gMethod · 0.45
_hMethod · 0.45
bazMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…