def METHOD_NAME(self):
    class X:
        pass
    x = X()
    x.local = self._local()
    x.local.x = x
    wr = weakref.ref(x)
    del x
    support.gc_collect()  # For PyPy or other GCs.
    self.assertIsNone(wr())