in later/unittest/case.py [0:0]
def __del__(self) -> None:
# So a pattern is to create_task, and not save the results.
# we accept that as long as there was no result other than None
# thrift-py3 uses this pattern to call rpc methods in ServiceInterfaces
# where any result/execption is returned to the remote client.
managed = self.was_managed()
if not managed and not (
self.done()
and not self.cancelled()
and not self.exception()
and self.result() is None
):
context = {
"task": self,
"message": (
"Task was destroyed but never awaited!, "
f"WrappedCoro: {self._coro_repr}"
),
}
# pyre-fixme[16]: `TestTask` has no attribute `_source_traceback`.
if self._source_traceback:
context["source_traceback"] = self._source_traceback
self._loop.call_exception_handler(context)
super().__del__()