'Runs the passed func twice and checks that the number of handles held
by the process hasn\'t increased between the first and the second run'

def _checkHandleLeak(self, func, *args, **kwargs):

    proc = psutil.Process()
    func(*args, **kwargs)
    middle = proc.num_handles()
    func(*args, **kwargs)
    end = proc.num_handles()
    self.assertEquals((end - middle), 0)
