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

Function test_alias_args_commented

IPython/core/tests/test_alias.py:43–53  ·  view source on GitHub ↗

Check that alias correctly ignores 'commented out' args

()

Source from the content-addressed store, hash-verified

41 nt.assert_equal(cap.stderr.split(':')[0], 'UsageError')
42
43def test_alias_args_commented():
44 """Check that alias correctly ignores 'commented out' args"""
45 _ip.magic('alias commetarg echo this is %%s a commented out arg')
46
47 with capture_output() as cap:
48 _ip.run_cell('commetarg')
49
50 # strip() is for pytest compat; testing via iptest patch IPython shell
51 # in testin.globalipapp and replace the system call which messed up the
52 # \r\n
53 assert cap.stdout.strip() == 'this is %s a commented out arg'
54
55def test_alias_args_commented_nargs():
56 """Check that alias correctly counts args, excluding those commented out"""

Callers

nothing calls this directly

Calls 3

capture_outputClass · 0.90
magicMethod · 0.45
run_cellMethod · 0.45

Tested by

no test coverage detected