code: def test_raises_error_when_r2_threshold_not_allowed():
      with pytest.raises(ValueError):
          SelectBySingleFeaturePerformance(
              RandomForestClassifier(random_state=1),
              scoring="r2",
              threshold=4,
          )
  
file_path: feature_engine/tests/test_selection/test_single_feature_performance_selection.py
imports: import warnings
  import numpy
  import pandas
  import pytest
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.linear_model import LinearRegression
  from sklearn.tree import DecisionTreeRegressor
  from feature_engine.selection import SelectBySingleFeaturePerformance
label_desc: Use image node_id 7 for calling a global function with example usage: test_raises_error_when_r2_threshold_not_allowed() without return types