Utility to loop over test inputs
(tests, transformer, **kwargs)
| 19 | |
| 20 | # Transformer tests |
| 21 | def 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 |
no test coverage detected