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

Method test_macro

IPython/core/tests/test_interactiveshell.py:682–690  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

680 self.assertEqual(called, [5])
681
682 def test_macro(self):
683 ip.push({'a':10})
684 # The AST transformation makes this do a+=-1
685 ip.define_macro("amacro", "a+=1\nprint(a)")
686
687 with tt.AssertPrints("9"):
688 ip.run_cell("amacro")
689 with tt.AssertPrints("8"):
690 ip.run_cell("amacro")
691
692class TestMiscTransform(unittest.TestCase):
693

Callers

nothing calls this directly

Calls 3

define_macroMethod · 0.80
pushMethod · 0.45
run_cellMethod · 0.45

Tested by

no test coverage detected