Esempio n. 1
0
def test_syntax_blockers(f):
    # reset Errors singleton
    errors = Errors()
    errors.reset()

    pyccel = Parser(f)

    with pytest.raises(PyccelSyntaxError):
        ast = pyccel.parse()

    assert (errors.has_blockers())
Esempio n. 2
0
def test_semantic_blocking_errors(f):
    print('> testing {0}'.format(str(f)))

    # reset Errors singleton
    errors = Errors()
    errors.reset()

    pyccel = Parser(f, show_traceback=False)
    ast = pyccel.parse()

    settings = {}
    with pytest.raises(PyccelSemanticError):
        ast = pyccel.annotate(**settings)

    assert (errors.has_blockers())