FrankYang0529 commented on code in PR #75029:
URL: https://github.com/apache/airflow/pull/75029#discussion_r4344446853
##########
task-sdk/tests/task_sdk/execution_time/test_supervisor.py:
##########
@@ -5548,6 +5548,33 @@ def
test_process_log_messages_from_subprocess(monkeypatch, caplog):
]
+def test_process_log_messages_reserved_kwarg_names_are_forwarded():
Review Comment:
nit: Could this test be parametrized, with one case per key?
```py
@pytest.mark.parametrize("key", ["target", "msg"])
@mock.patch(
"airflow.sdk.execution_time.supervisor.reconfigure_logger",
side_effect=lambda logger, *args, **kwargs: logger,
)
def test_process_log_messages_forwards_target_and_msg_keys(mock_reconfigure,
key):
target_logger = mock.Mock(spec=FilteringBoundLogger)
gen = process_log_messages_from_subprocess(loggers=(target_logger,))
next(gen)
gen.send(json.dumps({"level": "info", "event": "deploying", key:
"prod"}).encode() + b"\n")
target_logger.log.assert_called_once_with(logging.INFO, "deploying",
**{key: "prod"})
```
--
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]