I had a customized operator that is using xcom_pull to get results from other tasks and I would like to run unit test by using pytest for this operator and mock xcom_pull
doubles.exceptions.UnallowedMethodCallError: Received unexpected call to 'xcom_pull' on <Task(CustomizedOperator):
Any idea how to mock the xcom_pull method. It seems that this method belongs to TaskInstance Class which will be created once the Operator task is being created. Should I mock the TaskInstance object instead?
I think my question is when the CustomizedOperator is created, will an instance of TaskInstance will be created as well? or the TaskInstance is created when the Dag is defined and created?