test_generic_function_attributes fails with pybind

Issue #983 resolved
Jørgen Dokken created an issue

The test test_generic_function_attributes fails with following message:

    with pytest.raises(RuntimeError):
>           e2(0, 0)
E           Failed: DID NOT RAISE <class 'RuntimeError'>

test_expression.py:432: Failed

Comments (7)

  1. Jan Blechta

    This is supposed to raise through

    void Function::eval(Array<double>& values, const Array<double>& x,
                        const Cell& dolfin_cell, const ufc::cell& ufc_cell) const
    {
    ...
      dolfin_assert(values.size() == value_size_loc);
    ...
    }
    

    which does not work when asserts are off. That's poor error handlin g.

  2. Jan Blechta

    The assert shouldn't be turned into error - eval can be in a tight loop.

    There used to be a check for that here in generated code, although noticed the comment Runtime checks (TODO: Better to check these when updating the value instead...).

  3. Jan Blechta

    The fix in branch is too complicated. Just disable the test when assertions are off. The fix in next.

  4. Log in to comment