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

Method test_macro

tests/test_interactiveshell.py:820–828  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

818 self.assertEqual(called, [5])
819
820 def test_macro(self):
821 ip.push({"a": 10})
822 # The AST transformation makes this do a+=-1
823 ip.define_macro("amacro", "a+=1\nprint(a)")
824
825 with tt.AssertPrints("9"):
826 ip.run_cell("amacro")
827 with tt.AssertPrints("8"):
828 ip.run_cell("amacro")
829
830
831class TestMiscTransform(unittest.TestCase):

Callers

nothing calls this directly

Calls 3

define_macroMethod · 0.80
pushMethod · 0.45
run_cellMethod · 0.45

Tested by

no test coverage detected