MCPcopy Index your code
hub / github.com/ipython/ipython / test_parse_options_preserve_non_option_string

Function test_parse_options_preserve_non_option_string

tests/test_magic.py:601–608  ·  view source on GitHub ↗

Test to assert preservation of non-option part of magic-block, while parsing magic options.

()

Source from the content-addressed store, hash-verified

599
600
601def test_parse_options_preserve_non_option_string():
602 """Test to assert preservation of non-option part of magic-block, while parsing magic options."""
603 m = DummyMagics(_ip)
604 opts, stmt = m.parse_options(
605 " -n1 -r 13 _ = 314 + foo", "n:r:", preserve_non_opts=True
606 )
607 assert opts == {"n": "1", "r": "13"}
608 assert stmt == "_ = 314 + foo"
609
610
611def test_run_magic_preserve_code_block():

Callers

nothing calls this directly

Calls 2

DummyMagicsClass · 0.85
parse_optionsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…