MCPcopy Index your code
hub / github.com/bpython/bpython / test_function_expressions

Method test_function_expressions

bpython/test/test_repl.py:271–291  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

269
270class TestArgspecInternal(unittest.TestCase):
271 def test_function_expressions(self):
272 te = self.assertTupleEqual
273 fa = lambda line: repl.Repl._funcname_and_argnum(line)
274 for line, (func, argnum) in [
275 ("spam(", ("spam", 0)),
276 ("spam((), ", ("spam", 1)),
277 ("spam.eggs((), ", ("spam.eggs", 1)),
278 ("spam[abc].eggs((), ", ("spam[abc].eggs", 1)),
279 ("spam[0].eggs((), ", ("spam[0].eggs", 1)),
280 ("spam[a + b]eggs((), ", ("spam[a + b]eggs", 1)),
281 ("spam().eggs((), ", ("spam().eggs", 1)),
282 ("spam(1, 2).eggs((), ", ("spam(1, 2).eggs", 1)),
283 ("spam(1, f(1)).eggs((), ", ("spam(1, f(1)).eggs", 1)),
284 ("[0].eggs((), ", ("[0].eggs", 1)),
285 ("[0][0]((), {}).eggs((), ", ("[0][0]((), {}).eggs", 1)),
286 ("a + spam[0].eggs((), ", ("spam[0].eggs", 1)),
287 ("spam(", ("spam", 0)),
288 ("spam(map([]", ("map", 0)),
289 ("spam((), ", ("spam", 1)),
290 ]:
291 te(fa(line), (func, argnum))
292
293
294class TestGetSource(unittest.TestCase):

Callers

nothing calls this directly

Calls 1

_funcname_and_argnumMethod · 0.80

Tested by

no test coverage detected