def METHOD_NAME(self, shapesAB):
    expected_exc = ValueError
    shapeA, shapeB = shapesAB
    A_np = np.ones(shapeA)
    B_np = np.ones(shapeB)
    A_num = num.ones(shapeA)
    B_num = num.ones(shapeB)
    with pytest.raises(expected_exc):
        np.matmul(A_np, B_np)
    with pytest.raises(expected_exc):
        num.matmul(A_num, B_num)