code: def test_exception(self):
      op = CreatePythonOperator(
          MainOpFunctionThatThrowsCustomError, [], []
      )
      with self.assertRaisesRegex(
          CustomError, "This is an intentional exception."
      ):
          workspace.RunOperatorOnce(op)
  
imports: from caffe2.python import core, workspace
  from caffe2.python.core import CreatePythonOperator
  import caffe2.python.hypothesis_test_util
  from hypothesis import given, settings
  import hypothesis.strategies
  import numpy
label_desc: Use image node_id 2 for calling the PythonOpTest obj's underlying member method code with example usage: obj.test_exception() without return types