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

Method test_indent

IPython/core/tests/test_inputsplitter.py:147–154  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

145 self.assertEqual(self.isp.source, '')
146
147 def test_indent(self):
148 isp = self.isp # shorthand
149 isp.push('x=1')
150 self.assertEqual(isp.get_indent_spaces(), 0)
151 isp.push('if 1:\n x=1')
152 self.assertEqual(isp.get_indent_spaces(), 4)
153 isp.push('y=2\n')
154 self.assertEqual(isp.get_indent_spaces(), 0)
155
156 def test_indent2(self):
157 isp = self.isp

Callers

nothing calls this directly

Calls 2

get_indent_spacesMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected