code: def testFailWhenNotRunningUnderContext(self):
      param = data_types.RuntimeParameter(name="test_param", ptype=int)
      with self.assertRaisesRegex(
          RuntimeError,
          r"attach_parameter\(\) must run under ParameterContext\.",
      ):
          parameter_utils.attach_parameter(param)
  
file_path: tfx/tfx/orchestration/kubeflow/v2/parameter_utils_test.py
imports: from concurrent import futures
  import tensorflow
  from tfx.orchestration import data_types
  from tfx.orchestration.kubeflow.v2 import parameter_utils
label_desc: Use image node_id 4 for calling the ParameterUtilsTest obj's underlying member method code with example usage: obj.testFailWhenNotRunningUnderContext() without return types