The GitHub Actions job "Scheduled verify release calendar" on airflow.git/main 
has failed.
Run started by GitHub user potiuk (triggered by potiuk).

Head commit for run:
2c9e759c7a4620f2d7de90393fb225cc4c024ca5 / Jarek Potiuk <[email protected]>
Fix SFTPHookAsync test fixture to return async context managers (#66678)

After #64465 changed the production code from
``sftp = await ssh_conn.start_sftp_client()`` to
``async with ssh_conn.start_sftp_client() as sftp:`` (and likewise for
``sftp.open()``), the ``sftp_hook_mocked`` fixture in
``providers/sftp/tests/conftest.py`` started returning coroutines from
those calls — ``AsyncMock(spec=SSHClientConnection)`` auto-makes
``start_sftp_client`` an ``AsyncMock`` whose call yields a coroutine,
not an async context manager — and every ``TestSFTPHookAsync`` test
that uses the fixture failed with ``TypeError: 'coroutine' object does
not support the asynchronous context manager protocol``.

In real asyncssh, both ``start_sftp_client()`` and ``SFTPClient.open()``
are decorated so a call returns an object that is both awaitable and
async-context-manageable; the production code only uses the
context-manager half. Override the auto-spec'd AsyncMocks with sync
MagicMocks that return a context-manager mock with ``__aenter__`` /
``__aexit__`` configured.

Restores 28 ``TestSFTPHookAsync`` tests in
``providers/sftp/tests/unit/sftp/hooks/test_sftp.py`` (blocking CI on
unrelated PRs since #64465 merged).

Report URL: https://github.com/apache/airflow/actions/runs/25655669709

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to