#34930: Parallel tests fail on Python 3.11+ and django 4.1.0+ when
IsolatedAsyncioTestCase is used
-------------------------------------+-------------------------------------
Reporter: Matt Hegarty | Owner: nobody
Type: Bug | Status: closed
Component: Testing framework | Version: 4.2
Severity: Normal | Resolution: needsinfo
Keywords: pickle | Triage Stage:
_contextvars.Context _contextvars | Unreviewed
Context |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Carlton Gibson):
So the tests don't run in parallel on macOS prior to Django 4.1
([https://docs.djangoproject.com/en/4.2/releases/4.1/#tests release
notes]) so the whole pickle step never gets hit. I'd guess that would
explain the issue there.
> It seems that IsolatedAsyncioTestCase hasn't been (ever?) supported?
That's the nub of it.
Django's `SimpleTestCase` added equivalent support for `async def` test
methods in Django 3.1
([https://docs.djangoproject.com/en/4.2/topics/testing/tools/#testing-
asynchronous-code docs]), but `IsolatedAsyncioTestCase` wasn't part of
that.
This ticket is maybe a feature request to add support for
`IsolatedAsyncioTestCase` subclasses but what's the need, and given the
error…
{{{
TypeError: cannot pickle '_contextvars.Context' object
}}}
… is it going to be feasible at all?
(It might be but, for me, I'd like some indication of a yes there before
accepting such, so we don't send folks down a dead-end rabbit hole.)
--
Ticket URL: <https://code.djangoproject.com/ticket/34930#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018b7184ab37-d986a754-b838-4025-bfa5-8ecc19e48369-000000%40eu-central-1.amazonses.com.