diff --git a/tests/public/flows/test_previously_awaited_methods.py b/tests/public/flows/test_previously_awaited_methods.py index b769ff3b586d..efd6a6632ef9 100644 --- a/tests/public/flows/test_previously_awaited_methods.py +++ b/tests/public/flows/test_previously_awaited_methods.py @@ -39,7 +39,11 @@ async def get_some_numbers_new_way(): len(w) == N * 2 + 4 ) # 1 submit, 1 wait, 1 result, 1 map, N waits, N results assert issubclass(w[0].category, DeprecationWarning) - assert "please remove the `await` keyword" in str(w[0].message) + assert all( + "please remove the `await` keyword" in str(warning.message) + for warning in w + if warning.category is DeprecationWarning + ) # Test the new way (without await) with warnings.catch_warnings(record=True) as w: