We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41e9a59 commit 712edf9Copy full SHA for 712edf9
Lib/test/test_asyncio/test_tasks.py
@@ -399,6 +399,18 @@ async def notmuch():
399
self.loop.run_until_complete(t1)
400
self.loop.run_until_complete(t2)
401
402
+ def test_task_set_name_pylong(self):
403
+ # test that setting the task name to a PyLong explicitly doesn't
404
+ # incorrectly trigger the deferred name formatting logic
405
+ async def notmuch():
406
+ return 123
407
+
408
+ t = self.new_task(self.loop, notmuch(), name=987654321)
409
+ self.assertEqual(t.get_name(), '987654321')
410
+ t.set_name(123456789)
411
+ self.assertEqual(t.get_name(), '123456789')
412
+ self.loop.run_until_complete(t)
413
414
def test_task_repr_name_not_str(self):
415
async def notmuch():
416
return 123
0 commit comments