potiuk commented on code in PR #68913:
URL: https://github.com/apache/airflow/pull/68913#discussion_r3681846284


##########
airflow-core/tests/unit/cli/commands/test_db_command.py:
##########
@@ -534,6 +534,23 @@ def test_cli_shell_invalid_ppg3(self):
         with pytest.raises(AirflowException, match=r"Unknown driver: 
invalid\+psycopg"):
             db_command.shell(self.parser.parse_args(["db", "shell"]))
 
+    @mock.patch(

Review Comment:
   This decorator patches `settings.engine.url` to a fixed 
`postgresql+psycopg2://postgres:airflow@postgres/`, but the first thing the 
test body does is patch the same target again with the parametrized `conn_uri` 
— so the decorator's value is never the one under test.
   
   It's harmless (the second positional argument is `new`, so no mock is 
injected into the signature, which is why the parameter list still works), but 
it's dead and misleading — a reader has to work out which patch wins. Dropping 
the decorator and keeping just the `with mock.patch(...)` inside says exactly 
what the test means.
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting



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