def METHOD_NAME(self, n):
    local = self._local()
    weaklist = []
    for i in range(n):
        t = threading.Thread(target=target, args=(local, weaklist))
        t.start()
        t.join()
    del t
    gc.collect()
    self.assertEqual(len(weaklist), n)
    # XXX _threading_local keeps the local of the last stopped thread alive.
    deadlist = [weak for weak in weaklist if weak() is None]
    self.assertIn(len(deadlist), (n-1, n))
    # Assignment to the same thread local frees it sometimes (!)
    local.someothervar = None
    gc.collect()
    deadlist = [weak for weak in weaklist if weak() is None]
    self.assertIn(len(deadlist), (n-1, n), (n, len(deadlist)))