def test_rparse_error2(gctorture): with pytest.raises(Exception) as excinfo: rparse("'\\g'") assert "an unrecognized escape in character string" in str( excinfo.value)
def test_reval(gctorture): exp = rparse("x = 1L") assert "expression" in rclass(exp) assert "integer" in rclass(reval(exp)) assert str(exp) == 'RObject{EXPRSXP}\nexpression(x = 1L)'
def test_rparse_error(gctorture): with pytest.raises(Exception) as excinfo: rparse("x =") assert str(excinfo.value).startswith("Error")