code: def test_error_if_all_constant_and_quasi_constant_features():
      # test case 6: when input contains all constant features
      with pytest.raises(ValueError):
          DropConstantFeatures().fit(
              pd.DataFrame({"col1": [1, 1, 1], "col2": [1, 1, 1]})
          )
  
      # test case 7: when input contains all constant and quasi constant features
      with pytest.raises(ValueError):
          transformer = DropConstantFeatures(tol=0.7)
          transformer.fit_transform(
              pd.DataFrame(
                  {
                      "col1": [1, 1, 1, 1],
                      "col2": [1, 1, 1, 1],
                      "col3": [1, 1, 1, 2],
                      "col4": [1, 1, 1, 2],
                  }
              )
          )
  
file_path: feature_engine/tests/test_selection/test_drop_constant_features.py
imports: import numpy
  import pandas
  import pytest
  from feature_engine.selection import DropConstantFeatures
label_desc: Use image node_id 8 for calling a global function with example usage: test_error_if_all_constant_and_quasi_constant_features() without return types