Transformer that throws SyntaxError if 'syntaxerror' is in the code.
(lines)
| 237 | |
| 238 | |
| 239 | def syntax_error_transformer(lines): |
| 240 | """Transformer that throws SyntaxError if 'syntaxerror' is in the code.""" |
| 241 | for line in lines: |
| 242 | pos = line.find("syntaxerror") |
| 243 | if pos >= 0: |
| 244 | e = SyntaxError('input contains "syntaxerror"') |
| 245 | e.text = line |
| 246 | e.offset = pos + 1 |
| 247 | raise e |
| 248 | return lines |
| 249 | |
| 250 | |
| 251 | class TerminalMagicsTestCase(unittest.TestCase): |
nothing calls this directly
no test coverage detected
searching dependent graphs…