disconnect() reads self._post_connect_task, but several tests build a bare TelegramAdapter via object.__new__() without calling __init__ (which sets the attr). Use getattr(..., None) so disconnect() works on those instances too (pitfall #17).