code: def test_whitening_error(rndstate, get_mats):
      """Test Whitening"""
      n_matrices, n_channels = 20, 6
      cov = get_mats(n_matrices, n_channels, "spd")
      # Test Fit
      with pytest.raises(ValueError):  # len dim_red not equal to 1
          Whitening(dim_red={"n_components": 2, "expl_var": 0.5}).fit(
              cov
          )
      with pytest.raises(ValueError):  # n_components not superior to 1
          Whitening(dim_red={"n_components": 0}).fit(cov)
      with pytest.raises(ValueError):  # n_components not a int
          Whitening(dim_red={"n_components": 2.5}).fit(cov)
      with pytest.raises(ValueError):  # expl_var out of bound
          Whitening(dim_red={"expl_var": 0}).fit(cov)
      with pytest.raises(ValueError):  # expl_var out of bound
          Whitening(dim_red={"expl_var": 1.1}).fit(cov)
      with pytest.raises(
          ValueError
      ):  # max_cond not strictly superior to 1
          Whitening(dim_red={"max_cond": 1}).fit(cov)
      with pytest.raises(ValueError):  # unknown key
          Whitening(dim_red={"abc": 42}).fit(cov)
      with pytest.raises(ValueError):  # unknown type
          Whitening(dim_red="max_cond").fit(cov)
      with pytest.raises(ValueError):  # unknown type
          Whitening(dim_red=20).fit(cov)
  
file_path: pyRiemann/tests/test_preprocessing.py
imports: import numpy
  from numpy.testing import assert_array_almost_equal
  import pytest
  from pyriemann.spatialfilters import Whitening
  from pyriemann.utils.mean import mean_covariance
label_desc: Use image node_id 2 for calling a global function with example usage: test_whitening_error(rndstate, get_mats) without return types