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
def f():
            return False
        task = self._run_as_operator(f)
        assert task.execute_callable() is False
    def test_lambda(self):
        with pytest.raises(AirflowException):
            PythonVirtualenvOperator(python_callable=lambda x: 4, task_id='task', dag=self.dag)
    def test_nonimported_as_arg(self):
        def f(_):
            return None
        self._run_as_operator(f, op_args=[datetime.utcnow()])
    def test_context(self):
        def f(templates_dict):
            return templates_dict['ds']
        self._run_as_operator(f, templates_dict={'ds': '{{ ds }}'})
    
    
    @pytest.mark.execution_timeout(120)
    @pytest.mark.filterwarnings("ignore::airflow.utils.context.AirflowContextDeprecationWarning")
    def test_airflow_context(self):
        def f(
            
            ds_nodash,
            inlets,
            next_ds,
            next_ds_nodash,
            outlets,
            params,
            prev_ds,