'Check a randint()-like function.'

def _check_randint(self, func, ptr, max_width):

    ints = []
    for i in range(10):
        ints.append(func(5, 500000000))
    self.assertEqual(len(ints), len(set(ints)), ints)
    if (sys.version_info >= (3,)):
        r = self._follow_cpython(ptr)
        for args in [(1, 5), (13, 5000), (20, ((2 ** 62) + (2 ** 61)))]:
            if (args[1] > max_width):
                continue
            self._check_dist(func, r.randint, [args], niters=10)
    self.assertRaises(ValueError, func, 5, 4)
    self.assertRaises(ValueError, func, 5, 2)
