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

Method test_syntax

IPython/core/tests/test_inputsplitter.py:398–411  ·  view source on GitHub ↗

Call all single-line syntax tests from the main object

(self)

Source from the content-addressed store, hash-verified

396 self.isp = isp.IPythonInputSplitter()
397
398 def test_syntax(self):
399 """Call all single-line syntax tests from the main object"""
400 isp = self.isp
401 for example in syntax.values():
402 for raw, out_t in example:
403 if raw.startswith(' '):
404 continue
405
406 isp.push(raw+'\n')
407 out_raw = isp.source_raw
408 out = isp.source_reset()
409 self.assertEqual(out.rstrip(), out_t,
410 tt.pair_fail_msg.format("inputsplitter",raw, out_t, out))
411 self.assertEqual(out_raw.rstrip(), raw.rstrip())
412
413 def test_syntax_multiline(self):
414 isp = self.isp

Callers

nothing calls this directly

Calls 3

pushMethod · 0.45
source_resetMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected