Currently the operator allows to set requirement as list that needs to be hard coded.
It would be nice if airflow can support reading from file directly (something similar to how operators read sql file)
tests/operators/test_python.py
raise ValueError(f'Invalid task id {ti.task_id} found!')
    def test_xcom_push(self):
        branch_op = BranchPythonOperator(
            task_id='make_choice', dag=self.dag, python_callable=lambda: 'branch_1'
        )
        self.branch_1.set_upstream(branch_op)
        self.branch_2.set_upstream(branch_op)
        self.dag.clear()
        dr = self.dag.create_dagrun(
            run_type=DagRunType.MANUAL,
            start_date=timezone.utcnow(),
            execution_date=DEFAULT_DATE,
            state=State.RUNNING,
        )
        branch_op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
        tis = dr.get_task_instances()
        for ti in tis:
            if ti.task_id == 'make_choice':
                assert ti.xcom_pull(task_ids='make_choice') == 'branch_1'
    def test_clear_skipped_downstream_task(self):
        """
        After a downstream task is skipped by BranchPythonOperator, clearing the skipped task
        should not cause it to be executed.
        """
        branch_op = BranchPythonOperator(
            task_id='make_choice', dag=self.dag, python_callable=lambda: 'branch_1'
        )
        branches = [self.branch_1, self.branch_2]
        branch_op >> branches
        self.dag.clear()