diff --git a/tests/test_imagewrapper.py b/tests/test_imagewrapper.py
index 1237cd55d02966fc5596c32825dcec071f9c8b2e..61ed5c21bbdbccef14f769b4547f9fdb8c6fd8a4 100644
--- a/tests/test_imagewrapper.py
+++ b/tests/test_imagewrapper.py
@@ -465,7 +465,10 @@ def _test_expansion(coverage, slices, volumes, expansions):
     # coverage, or in one of the expansions.
     dimranges = []
     for d in range(ndims):
-        dimranges.append(np.linspace(nc[0, d], nc[1, d], nc[1, d] / 5, dtype=np.uint32))
+        dimranges.append(np.linspace(nc[0, d],
+                                     nc[1, d],
+                                     int(nc[1, d] / 5),
+                                     dtype=np.uint32))
 
     points = it.product(*dimranges)