def check_alloc_size(self, pyfunc):
        """Checks that pyfunc will error, not segfaulting due to array size."""
        cfunc = nrtjit(pyfunc)
        with self.assertRaises(ValueError) as e:
            cfunc()
        self.assertIn(
            "array is too big",
            str(e.exception)
        )
Checks that pyfunc will error, not segfaulting due to array size.
numba/tests/test_dyn_array.py