ashb commented on code in PR #44229:
URL: https://github.com/apache/airflow/pull/44229#discussion_r1851447844


##########
task_sdk/tests/api/test_client.py:
##########
@@ -74,3 +75,61 @@ def handle_request(request: httpx.Request) -> httpx.Response:
             client.get("http://error";)
         assert err.value.args == ("Not found",)
         assert err.value.detail is None
+
+
+def get_client(transport: httpx.MockTransport) -> Client:

Review Comment:
   Nit:
   ```suggestion
   def make_client(transport: httpx.MockTransport) -> Client:
   ```
   



##########
task_sdk/tests/execution_time/test_supervisor.py:
##########
@@ -225,3 +225,86 @@ def test_run_simple_dag(self, test_dags_dir, 
captured_logs, time_machine):
             "logger": "task",
             "timestamp": "2024-11-07T12:34:56.078901Z",
         } in captured_logs
+
+
+class TestHandleRequest:
+    @pytest.fixture
+    def watched_subprocess(self, mocker):
+        """Fixture to provide a WatchedSubprocess instance."""
+        return WatchedSubprocess(
+            ti_id=uuid7(),
+            pid=12345,
+            stdin=mocker.Mock(),  # Not used in these tests
+            stdout=mocker.Mock(),  # Not used in these tests
+            stderr=mocker.Mock(),  # Not used in these tests
+            client=mocker.Mock(),
+            process=mocker.Mock(),
+        )
+
+    @pytest.mark.parametrize(
+        "message, expected_buffer, client_attr_path, method_arg, 
mock_response",

Review Comment:
   Please use the list of strings form



##########
task_sdk/tests/execution_time/test_supervisor.py:
##########
@@ -225,3 +225,86 @@ def test_run_simple_dag(self, test_dags_dir, 
captured_logs, time_machine):
             "logger": "task",
             "timestamp": "2024-11-07T12:34:56.078901Z",
         } in captured_logs
+
+
+class TestHandleRequest:
+    @pytest.fixture
+    def watched_subprocess(self, mocker):
+        """Fixture to provide a WatchedSubprocess instance."""
+        return WatchedSubprocess(
+            ti_id=uuid7(),
+            pid=12345,
+            stdin=mocker.Mock(),  # Not used in these tests
+            stdout=mocker.Mock(),  # Not used in these tests
+            stderr=mocker.Mock(),  # Not used in these tests
+            client=mocker.Mock(),
+            process=mocker.Mock(),
+        )
+
+    @pytest.mark.parametrize(
+        "message, expected_buffer, client_attr_path, method_arg, 
mock_response",
+        [
+            (
+                GetConnection(conn_id="test_conn"),

Review Comment:
   These test memes will be long, we should probably use the `pytest.param()` 
here to give each one a cousin id



-- 
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