@contextlib.contextmanager
    def assertRefCount(self, *objects):
        old_refcounts = [sys.getrefcount(x) for x in objects]
        yield
        new_refcounts = [sys.getrefcount(x) for x in objects]
        for old, new, obj in zip(old_refcounts, new_refcounts, objects):
            if old != new:
                self.fail("Refcount changed from %d to %d for object: %r"
                          % (old, new, obj))
A context manager that asserts the given objects have the
dataset/ETHPy150Open numba/numba/numba/tests/support.py/TestCase.assertRefCount