MCPcopy Create free account
hub / github.com/bpython/bpython / test_issue_966_freestanding

Method test_issue_966_freestanding

bpython/test/test_inspection.py:152–181  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

150 self.assertEqual(props.argspec.args, ["object", "dtype"])
151
152 def test_issue_966_freestanding(self):
153 def fun(number, lst=[]):
154 """
155 Return a list of numbers
156
157 Example:
158 ========
159 C.cmethod(1337, [1, 2]) # => [1, 2, 1337]
160 """
161 return lst + [number]
162
163 def fun_annotations(number: int, lst: list[int] = []) -> list[int]:
164 """
165 Return a list of numbers
166
167 Example:
168 ========
169 C.cmethod(1337, [1, 2]) # => [1, 2, 1337]
170 """
171 return lst + [number]
172
173 props = inspection.getfuncprops("fun", fun)
174 self.assertEqual(props.func, "fun")
175 self.assertEqual(props.argspec.args, ["number", "lst"])
176 self.assertEqual(repr(props.argspec.defaults[0]), "[]")
177
178 props = inspection.getfuncprops("fun_annotations", fun_annotations)
179 self.assertEqual(props.func, "fun_annotations")
180 self.assertEqual(props.argspec.args, ["number", "lst"])
181 self.assertEqual(repr(props.argspec.defaults[0]), "[]")
182
183 def test_issue_966_class_method(self):
184 class Issue966(Sequence):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected