You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jscheffl (via GitHub)" <gi...@apache.org> on 2024/07/07 11:41:42 UTC

Re: [PR] Load Example Plugins with Example DAGs [airflow]

jscheffl commented on code in PR #39999:
URL: https://github.com/apache/airflow/pull/39999#discussion_r1667675206


##########
tests/cli/commands/test_dag_command.py:
##########
@@ -425,37 +425,37 @@ def test_cli_backfill_depends_on_past_run_backwards(self, mock_run, cli_arg: str
             disable_retry=False,
         )
 
-    @mock.patch("workday.AfterWorkdayTimetable.get_next_workday")
     @mock.patch("airflow.models.taskinstance.TaskInstance.dry_run")
     @mock.patch("airflow.cli.commands.dag_command.DagRun")
-    def test_backfill_with_custom_timetable(self, mock_dagrun, mock_dry_run, mock_get_next_workday):
+    def test_backfill_with_custom_timetable(self, mock_dagrun, mock_dry_run):
         """
         when calling `dags backfill` on dag with custom timetable, the DagRun object should be created with
          data_intervals.
         """
 
         start_date = DEFAULT_DATE + timedelta(days=1)
         end_date = start_date + timedelta(days=1)
-        workdays = [
+        mock_next_workday = [
             start_date,
             start_date + timedelta(days=1),
             start_date + timedelta(days=2),
         ]
-        mock_get_next_workday.side_effect = workdays
+        from airflow.example_dags.plugins.workday import AfterWorkdayTimetable

Review Comment:
   Need to change decorator to load patch on manually imported module inside the pytest. don't ask me why but with the decorator as it was before it gets a `AttributeError: module 'airflow.example_dags.plugins' has no attribute 'workday'` in Python 3.8 - works in 3.12...



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org