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
("task1", [State.SUCCESS, State.SUCCESS, State.SUCCESS]),
        ("join", [State.SUCCESS, State.SKIPPED, State.SUCCESS]),
    ],
)
def test_empty_branch(dag_maker, choice, expected_states):
    """
    Tests that BranchPythonOperator handles empty branches properly.
    """
    with dag_maker(
        'test_empty_branch',
        start_date=DEFAULT_DATE,
    ) as dag:
        branch = BranchPythonOperator(task_id='branch', python_callable=lambda: choice)
        task1 = DummyOperator(task_id='task1')
        join = DummyOperator(task_id='join', trigger_rule="none_failed_min_one_success")
        branch >> [task1, join]
        task1 >> join
    dag.clear(start_date=DEFAULT_DATE)
    dag_run = dag_maker.create_dagrun()
    task_ids = ["branch", "task1", "join"]
    tis = {ti.task_id: ti for ti in dag_run.task_instances}
    for task_id in task_ids:  
        task_instance = tis[task_id]
        task_instance.refresh_from_task(dag.get_task(task_id))
        task_instance.run()
    def get_state(ti):
        ti.refresh_from_db()
        return ti.state
    assert [get_state(tis[task_id]) for task_id in task_ids] == expected_states
def test_virtualenv_serializable_context_fields(create_task_instance):