From c06052173241a35bca06b461c22e535e76bd4728 Mon Sep 17 00:00:00 2001 From: Shalabh Gupta Date: Mon, 9 Mar 2026 21:46:42 +0530 Subject: [PATCH] Fix deprecated asyncio.iscoroutinefunction usage in test_cleanup_hooks.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #4522 Replace deprecated `asyncio.iscoroutinefunction()` with `inspect.iscoroutinefunction()` to resolve Python 3.13+ deprecation warning. Changes: - Added `import inspect` to imports - Replaced `asyncio.iscoroutinefunction(hook)` with `inspect.iscoroutinefunction(hook)` on line 126 - This makes the code consistent with other test methods in the same file (lines 201, 236) The rest of the file already uses `inspect.iscoroutinefunction()` correctly, making this change consistent with the existing codebase pattern. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- python/packages/devui/tests/devui/test_cleanup_hooks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/packages/devui/tests/devui/test_cleanup_hooks.py b/python/packages/devui/tests/devui/test_cleanup_hooks.py index 8d02bfaf27..7f36f68165 100644 --- a/python/packages/devui/tests/devui/test_cleanup_hooks.py +++ b/python/packages/devui/tests/devui/test_cleanup_hooks.py @@ -3,6 +3,7 @@ """Tests for cleanup hook registration and execution.""" import asyncio +import inspect import tempfile from pathlib import Path @@ -123,7 +124,7 @@ async def test_register_cleanup_multiple_hooks(): # Execute all hooks for hook in hooks: - if asyncio.iscoroutinefunction(hook): + if inspect.iscoroutinefunction(hook): await hook() else: hook()