Skip to content

Commit d407a0b

Browse files
committed
Add test
1 parent f1b2db8 commit d407a0b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Lib/test/test_asyncio/test_futures.py

+15
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,21 @@ def __eq__(self, other):
832832

833833
fut.remove_done_callback(evil())
834834

835+
def test_remove_done_callbacks_list_clear(self):
836+
# see https://github.com/python/cpython/issues/97592 for details
837+
838+
fut = self._new_future()
839+
fut.add_done_callback(str)
840+
841+
for _ in range(63):
842+
fut.add_done_callback(id)
843+
844+
class evil:
845+
def __eq__(self, other):
846+
fut.remove_done_callback(other)
847+
848+
fut.remove_done_callback(evil())
849+
835850
def test_schedule_callbacks_list_mutation_1(self):
836851
# see http://bugs.python.org/issue28963 for details
837852

0 commit comments

Comments
 (0)