code: def test_check_weights():
      X, y = build_dataset(30, 42)
      weights = np.ones(X.shape[1] // 7)
      weights[0] = 0
      clf = GroupLasso(weights=weights, groups=7)  # groups of size 7
      # weights must be > 0
      np.testing.assert_raises(ValueError, clf.fit, X=X, y=y)
      # len(weights) must be equal to number of groups (6 here)
      clf.weights = np.ones(8)
      np.testing.assert_raises(ValueError, clf.fit, X=X, y=y)
  
imports: import pytest
  import itertools
  import numpy
  from numpy.linalg import norm
  from numpy.testing import assert_allclose, assert_array_less, assert_array_equal
  from sklearn.utils.estimator_checks import check_estimator
  from sklearn.linear_model import MultiTaskLassoCV
  from sklearn.linear_model import MultiTaskLasso
  from sklearn.linear_model import lasso_path
  from celer import Lasso, GroupLasso, GroupLassoCV, MultiTaskLasso, MultiTaskLassoCV
  from celer.homotopy import celer_path, mtl_path, _grp_converter
  from celer.group_fast import dnorm_grp
  from celer.utils.testing import build_dataset
label_desc: Use image node_id 11 for calling a global function with example usage: test_check_weights() without return types