evgeniy-b commented on code in PR #63730:
URL: https://github.com/apache/airflow/pull/63730#discussion_r2987378563


##########
providers/google/tests/unit/google/cloud/triggers/test_bigquery.py:
##########
@@ -258,11 +258,9 @@ async def test_bigquery_insert_job_trigger_cancellation(
 
         caplog.set_level(logging.INFO)
 
-        try:
+        with pytest.raises(asyncio.CancelledError):
             async for _ in insert_job_trigger.run():
                 pass
-        except asyncio.CancelledError:
-            pass

Review Comment:
   Previous implementation was silently skipping `CancelledError` (except -> 
pass). The tests would ignore it if the exception was raised.
   The change ensures that the run() raises `CancelledError` by wrapping in 
`pytest.raises`



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