code: def test_covariance_errors(
      data: ArrayLike, estimator: type[CovarianceEstimator]
  ):
      with pytest.raises(
          ValueError, match="Degrees of freedom is <= 0"
      ):
          estimator(data, df_adjust=data.shape[0] + 1)
      with pytest.raises(
          ValueError, match="df_adjust must be a non-negative"
      ):
          estimator(data, df_adjust=-2)
      with pytest.raises(
          ValueError, match="df_adjust must be a non-negative"
      ):
          # Type ignored due to invalid type used in test
          estimator(data, df_adjust=np.ones(2))  # type: ignore
      with pytest.raises(ValueError, match="bandwidth must be"):
          estimator(data, bandwidth=-3)
      with pytest.raises(ValueError, match="weights must be"):
          estimator(data, weights=np.ones(7))
  
file_path: arch/arch/tests/covariance/test_covariance.py
imports: from itertools import product
  import numpy
  from numpy.testing import assert_allclose
  import pandas
  import pytest
  from arch.covariance.kernel import Andrews, Bartlett, CovarianceEstimate, CovarianceEstimator, Gallant, NeweyWest, Parzen, ParzenCauchy, ParzenGeometric, ParzenRiesz, QuadraticSpectral, TukeyHamming, TukeyHanning, TukeyParzen
  from arch.typing import ArrayLike
label_desc: Use image node_id 4 for calling a global function with example usage: test_covariance_errors(data, estimator) without return types