FrankYang0529 commented on code in PR #72858:
URL: https://github.com/apache/airflow/pull/72858#discussion_r3979657068


##########
airflow-core/tests/unit/cli/test_cli_parser.py:
##########
@@ -179,7 +179,7 @@ def test_dynamic_conflict_detection(self, 
mock_cli_command_functions: MagicMock)
 
     @pytest.mark.parametrize(
         "module_pattern",
-        ["airflow.auth.managers", "airflow.executors.executor_loader"],
+        ["airflow.api_fastapi.auth.managers", 
"airflow.executors.base_executor"],

Review Comment:
   I agree these are two different changes and fix the docstring.
   
   I tried keeping the import lazy, and the `executor_loader` case still fails. 
The executor block now runs on every start to look for custom classes, so the 
import inside it runs during the test. That case only passes when 
`AIRFLOW_PACKAGE_NAME` is set.
   
   A lazy import also would not guard against a real cost. `executor_loader` 
was already in `sys.modules` before `cli_parser` ran, including with 
`AIRFLOW_PACKAGE_NAME` set. The first import comes from `import airflow` 
itself, through `settings`, `logging_config` and `file_task_handler`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to