'Check choice(a, size, replace) against pop.'

def _check_choice_3(self, a, pop):

    cfunc = jit(nopython=True)(numpy_choice3)
    n = len(pop)
    sizes = [(n - 10), (3, ((n - 1) // 3))]
    replaces = [True, False]
    for size in sizes:
        for replace in [True, False]:
            res = cfunc(a, size, replace)
            expected_shape = (size if isinstance(size, tuple) else (size,))
            self.assertEqual(res.shape, expected_shape)
    for size in sizes:
        self._check_array_results((lambda : cfunc(a, size, True)), pop)
    for size in sizes:
        self._check_array_results((lambda : cfunc(a, size, False)), pop, False)
    for size in [(n + 1), (3, ((n // 3) + 1))]:
        with self.assertRaises(ValueError):
            cfunc(a, size, False)
