MCPcopy Create free account
hub / github.com/ipython/ipython / test_extract_code_ranges

Function test_extract_code_ranges

IPython/core/tests/test_magic.py:41–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39class DummyMagics(magic.Magics): pass
40
41def test_extract_code_ranges():
42 instr = "1 3 5-6 7-9 10:15 17: :10 10- -13 :"
43 expected = [(0, 1),
44 (2, 3),
45 (4, 6),
46 (6, 9),
47 (9, 14),
48 (16, None),
49 (None, 9),
50 (9, None),
51 (None, 13),
52 (None, None)]
53 actual = list(code.extract_code_ranges(instr))
54 nt.assert_equal(actual, expected)
55
56def test_extract_symbols():
57 source = """import foo\na = 10\ndef b():\n return 42\n\n\nclass A: pass\n\n\n"""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected