Skip to content

Python: Fix deprecated asyncio.iscoroutinefunction usage in test_cleanup_hooks.py#4563

Open
coding-shalabh wants to merge 1 commit intomicrosoft:mainfrom
coding-shalabh:fix/asyncio-iscoroutinefunction-deprecation
Open

Python: Fix deprecated asyncio.iscoroutinefunction usage in test_cleanup_hooks.py#4563
coding-shalabh wants to merge 1 commit intomicrosoft:mainfrom
coding-shalabh:fix/asyncio-iscoroutinefunction-deprecation

Conversation

@coding-shalabh
Copy link

Summary

Fixes #4522

Replaces deprecated asyncio.iscoroutinefunction() with inspect.iscoroutinefunction() to resolve Python 3.13+ deprecation warning.

Changes Made

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

Why This Change?

Python 3.13+ deprecated asyncio.iscoroutinefunction() in favor of inspect.iscoroutinefunction(). The rest of test_cleanup_hooks.py already uses inspect.iscoroutinefunction() correctly, making this change consistent with the existing codebase pattern.

Testing

  • Existing tests should pass without warnings
  • No functional changes, only replacing deprecated API

Related Issues

Closes #4522


🤖 Generated with Claude Code

…s.py

Fixes microsoft#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 <noreply@anthropic.com>
@github-actions github-actions bot changed the title Fix deprecated asyncio.iscoroutinefunction usage in test_cleanup_hooks.py Python: Fix deprecated asyncio.iscoroutinefunction usage in test_cleanup_hooks.py Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Bug]: asyncio.iscoroutinefunction is deprecated

2 participants