code: def test_raises_exception_if_method_not_redefined(tmpdir):
      # Now that I think about it, this really just is a complicated way to test the self._ensure_method_overriden function.
      with pytest.raises(NotImplementedError) as exception_info:
          BadForceHandleStep()
  
      assert (
          "Please define _fit_data_container"
          in exception_info.value.args[0]
      )
      assert "in BadForceHandleStep" in exception_info.value.args[0]
  
      def _fit_data_container(self, data_container: DACT, context: CX):
          return self
  
      BadForceHandleStep._fit_data_container = _fit_data_container
  
      with pytest.raises(NotImplementedError) as exception_info:
          BadForceHandleStep()
  
      assert (
          "Please define _fit_transform_data_container"
          in exception_info.value.args[0]
      )
      assert "in BadForceHandleStep" in exception_info.value.args[0]
  
      def _fit_transform_data_container(
          self, data_container: DACT, context: CX
      ):
          return self, data_container
  
      BadForceHandleStep._fit_transform_data_container = (
          _fit_transform_data_container
      )
  
      with pytest.raises(NotImplementedError) as exception_info:
          BadForceHandleStep()
  
      assert (
          "Please define _transform_data_container"
          in exception_info.value.args[0]
      )
      assert "in BadForceHandleStep" in exception_info.value.args[0]
  
      def _transform_data_container(
          self, data_container: DACT, context: CX
      ):
          return data_container
  
      BadForceHandleStep._transform_data_container = (
          _transform_data_container
      )
  
      # Should not raise any error now.
      BadForceHandleStep()
  
file_path: Neuraxle/testing_neuraxle/test_forcehandle_mixin.py
imports: import numpy
  import pytest
  from neuraxle.base import BaseStep
  from neuraxle.base import ExecutionContext
  from neuraxle.base import ForceHandleIdentity, ForceHandleMixin
  from neuraxle.data_container import DataContainer
  from neuraxle.pipeline import Pipeline
label_desc: Use image node_id 1 for calling a global function with example usage: test_raises_exception_if_method_not_redefined(tmpdir) and returns: self, self,  data_container, data_container