class_docstr: Module level tests for all sktime classifiers.
docstr: Test that estimator handles fit when only single class label is seen.
  
  This is important for compatibility with ensembles that sub-sample, as sub-
  sampling stochastically produces training sets with single class label.
docstr_tok: ["Test","that","estimator","handles","fit","when","only","single","class","label","is","seen",".","This","is","important","for","compatibility","with","ensembles","that","sub-sample",",","as","sub-","sampling","stochastically","produces","training","sets","with","single","class","label","."]
code: def test_handles_single_class(self, estimator_instance):
      """Test that estimator handles fit when only single class label is seen.
  
      This is important for compatibility with ensembles that sub-sample, as sub-
      sampling stochastically produces training sets with single class label.
      """
      X, y = make_classification_problem()
      y[:] = 42
  
      error_msg = "single label"
  
      with pytest.warns(UserWarning, match=error_msg):
          estimator_instance.fit(X, y)
  
imports: import numpy
  import pandas
  import pytest
  from sktime.classification.tests._expected_outputs import basic_motions_proba, unit_test_proba
  from sktime.datasets import load_basic_motions, load_unit_test
  from sktime.datatypes import check_is_scitype
  from sktime.tests.test_all_estimators import BaseFixtureGenerator, QuickTester
  from sktime.utils._testing.estimator_checks import _assert_array_almost_equal
  from sktime.utils._testing.panel import make_classification_problem
  from sktime.utils._testing.scenarios_classification import ClassifierFitPredictMultivariate
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 5 for calling the TestAllClassifiers obj's underlying member method code with example usage: obj.test_handles_single_class(estimator_instance) without return types