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

Function transform_checker

IPython/core/tests/test_inputtransformer.py:21–32  ·  view source on GitHub ↗

Utility to loop over test inputs

(tests, transformer, **kwargs)

Source from the content-addressed store, hash-verified

19
20# Transformer tests
21def transform_checker(tests, transformer, **kwargs):
22 """Utility to loop over test inputs"""
23 transformer = transformer(**kwargs)
24 try:
25 for inp, tr in tests:
26 if inp is None:
27 out = transformer.reset()
28 else:
29 out = transformer.push(inp)
30 nt.assert_equal(out, tr)
31 finally:
32 transformer.reset()
33
34# Data for all the syntax tests in the form of lists of pairs of
35# raw/transformed input. We store it here as a global dict so that we can use

Callers 6

test_classic_promptFunction · 0.85
test_ipy_promptFunction · 0.85
test_cellmagicFunction · 0.85

Calls 2

resetMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected