@task.docker(image="python:3.9-slim", auto_remove="force")
        def f():
            pass
        with dag_maker():
            ret = f()
        dr = dag_maker.create_dagrun()
        ret.operator.run(start_date=dr.execution_date, end_date=dr.execution_date)
        ti = dr.get_task_instances()[0]
        assert ti.xcom_pull() is None
    def test_call_decorated_multiple_times(self):
        """Test calling decorated function 21 times in a DAG"""
        @task.docker(image="python:3.9-slim", network_mode="bridge", api_version="auto", auto_remove="force")
        def do_run():
            return 4
        with DAG("test", start_date=DEFAULT_DATE) as dag:
            do_run()
            for _ in range(20):
                do_run()
        assert len(dag.task_ids) == 21
        assert dag.task_ids[-1] == "do_run__20"
    @pytest.mark.parametrize(
        "extra_kwargs, actual_exit_code, expected_state",
        [
            (None, 99, TaskInstanceState.FAILED),
            ({"skip_exit_code": 100}, 100, TaskInstanceState.SKIPPED),
            ({"skip_exit_code": 100}, 101, TaskInstanceState.FAILED),
            ({"skip_exit_code": None}, 0, TaskInstanceState.SUCCESS),
        ],
    )
    def test_skip_docker_operator(self, extra_kwargs, actual_exit_code, expected_state, dag_maker):