def check_arr(arr): dims = arr.shape strides = arr.strides itemsize = arr.dtype.itemsize is_c = numpy_support.is_contiguous(dims, strides, itemsize) is_f = numpy_support.is_fortran(dims, strides, itemsize) expect_c = arr.flags['C_CONTIGUOUS'] expect_f = arr.flags['F_CONTIGUOUS'] self.assertEqual(is_c, expect_c) self.assertEqual(is_f, expect_f)