TST: Fix ValueError: Buffer dtype mismatch, expected 'intp_t' but got 'long'