'attach a finalizer to the given colitem.
if colitem is None, this will add a finalizer that
is called at the end of teardown_all().'

def addfinalizer(self, finalizer, colitem):

    assert (colitem and (not isinstance(colitem, tuple)))
    assert py.builtin.callable(finalizer)
    self._finalizers.setdefault(colitem, []).append(finalizer)
