Skip to content

Conversation

@adamchainz
Copy link
Contributor

@adamchainz adamchainz commented Nov 14, 2025

Description

Fix these warnings seen in the Python 3.14 test run:

test middleware switches to async (__acall__) based on get_response type ... /home/runner/work/django-debug-toolbar/django-debug-toolbar/tests/test_middleware.py:57: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
  self.assertTrue(asyncio.iscoroutinefunction(middleware))

test middleware switches to sync (__call__) based on get_response type ... /home/runner/work/django-debug-toolbar/django-debug-toolbar/tests/test_middleware.py:38: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
  self.assertFalse(asyncio.iscoroutinefunction(middleware))

inspect.iscoroutinefunction() has always been the public API, since Python 3.5, though we need markcoroutine() support, which was added in Python 3.12.

Checklist:

  • I have added the relevant tests for this change.
  • I have added an item to the Pending section of docs/changes.rst.

Fix these warnings seen in the test run:

```
test middleware switches to async (__acall__) based on get_response type ... /home/runner/work/django-debug-toolbar/django-debug-toolbar/tests/test_middleware.py:57: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
  self.assertTrue(asyncio.iscoroutinefunction(middleware))

test middleware switches to sync (__call__) based on get_response type ... /home/runner/work/django-debug-toolbar/django-debug-toolbar/tests/test_middleware.py:38: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
  self.assertFalse(asyncio.iscoroutinefunction(middleware))
```

[`inspect.iscoroutinefunction()`](https://docs.python.org/3/library/inspect.html#inspect.iscoroutinefunction) has always been the public API, since Python 3.5, though we need `markcoroutine()` support, which was added in Python 3.12.
@github-actions
Copy link

Coverage report

This PR does not seem to contain any modification to coverable code.

@matthiask matthiask merged commit ec4e653 into django-commons:main Nov 14, 2025
32 checks passed
@matthiask
Copy link
Member

Nice, thanks!

federicobond pushed a commit to federicobond/django-debug-toolbar that referenced this pull request Nov 26, 2025
…s#2251)

Fix these warnings seen in the test run:

```
test middleware switches to async (__acall__) based on get_response type ... /home/runner/work/django-debug-toolbar/django-debug-toolbar/tests/test_middleware.py:57: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
  self.assertTrue(asyncio.iscoroutinefunction(middleware))

test middleware switches to sync (__call__) based on get_response type ... /home/runner/work/django-debug-toolbar/django-debug-toolbar/tests/test_middleware.py:38: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
  self.assertFalse(asyncio.iscoroutinefunction(middleware))
```

[`inspect.iscoroutinefunction()`](https://docs.python.org/3/library/inspect.html#inspect.iscoroutinefunction) has always been the public API, since Python 3.5, though we need `markcoroutine()` support, which was added in Python 3.12.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants