def test_badviewmap_c(self):
     x = dvector()
     f = function([x], wb1i(x), mode=DebugMode(check_py_code=False))
     with pytest.raises(BadViewMap):
         f([1, 2])
def test_just_c_code():
    x = dvector()
    f = function([x], wb2(x), mode=DebugMode(check_py_code=False))
    assert np.all(f([1, 2]) == [2, 4])
def test_baddestroymap_c():
    x = dvector()
    f = function([x], wb2i(x), mode=DebugMode(check_py_code=False))
    with pytest.raises(BadDestroyMap):
        assert np.all(f([1, 2]) == [2, 4])
def test_debugmode_basic():
    x = dvector()
    f = function([x], ((2.0 * x) + 7) / 2.0, mode=DebugMode())
    f([1, 2])