ashb commented on code in PR #51699:
URL: https://github.com/apache/airflow/pull/51699#discussion_r2150425204
##########
devel-common/src/tests_common/pytest_plugin.py:
##########
@@ -1956,17 +1956,20 @@ def override_caplog(request):
@pytest.fixture
-def mock_supervisor_comms():
+def mock_supervisor_comms(monkeypatch):
# for back-compat
from tests_common.test_utils.version_compat import AIRFLOW_V_3_0_PLUS
if not AIRFLOW_V_3_0_PLUS:
yield None
return
- with mock.patch(
- "airflow.sdk.execution_time.task_runner.SUPERVISOR_COMMS", create=True
- ) as supervisor_comms:
- yield supervisor_comms
+
+ import airflow.sdk.execution_time.task_runner
+ from airflow.sdk.execution_time.comms import CommsDecoder
+
+ comms = mock.create_autospec(CommsDecoder)
+ monkeypatch.setattr(airflow.sdk.execution_time.task_runner,
"SUPERVISOR_COMMS", comms, raising=False)
Review Comment:
Probably worth it. If I'm making any other changes/fixes to this PR I'll do
it
--
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]