Taragolis commented on code in PR #38518:
URL: https://github.com/apache/airflow/pull/38518#discussion_r1540207045
##########
tests/providers/sftp/hooks/test_sftp.py:
##########
@@ -405,12 +405,11 @@ def test_deprecation_ftp_conn_id(self,
mock_get_connection):
@mock.patch("airflow.providers.sftp.hooks.sftp.SFTPHook.get_connection")
def test_invalid_ssh_hook(self, mock_get_connection):
with pytest.raises(AirflowException, match="ssh_hook must be an
instance of SSHHook"):
- connection = Connection(conn_id="sftp_default", login="root",
host="localhost")
- mock_get_connection.return_value = connection
- with pytest.warns(
- AirflowProviderDeprecationWarning, match=r"Parameter
`ssh_hook` is deprecated.*"
- ):
Review Comment:
I would rather keep this one, you could move `pytest.warns` in top of
`pytest.raises`, or join them, e.g.
```python
with pytest.raises(
AirflowException, match="ssh_hook must be an instance of SSHHook"
), pytest.warns(
AirflowProviderDeprecationWarning, match=r"Parameter `ssh_hook` is
deprecated.*"
):
```
--
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]