diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ed6accb9..b5bdc6f3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -57,8 +57,6 @@ jobs: - name: Install Python Deps if: steps.release.outputs.version == 0 - env: - PIP_PRE: ${{ matrix.python-version == '3.13' && '1' || '0' }} run: | pip install -e .[test,dev] diff --git a/tests/test_base.py b/tests/test_base.py index 86bbd1d0..feac44b8 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -576,9 +576,14 @@ def get_name(self): async def coro(): pass - factory = lambda loop, coro, **kwargs: MyTask( - coro, loop=loop, **kwargs - ) + def factory(loop, coro, **kwargs): + task = MyTask(coro, loop=loop, **kwargs) + # Python moved the responsibility to set the name to the Task + # class constructor, so MyTask.set_name is never called by + # Python's create_task. Compensate for that here. + if self.is_asyncio_loop() and "name" in kwargs: + task.set_name(kwargs["name"]) + return task self.assertIsNone(self.loop.get_task_factory()) task = self.loop.create_task(coro(), name="mytask")