Add usage error for tests.common.intspace helper function
@@ -122,6 +122,10 @@ def intspace(start, stop, num=50, dtype=np.int64):
step = (stop-start) // num
nextval = start
+ if np.issubdtype(dtype, np.integer) and step < 1:
+ raise ValueError("Cannot use non-integral step value '{}' for integer dtype!".format(
+ step))
+
for i in range(num):
rval[i] = nextval
nextval += step
