summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schönberger <hannesschoenberger@gmail.com>2013-01-13 20:49:41 +0100
committerJohannes Schönberger <jschoenberger@demuc.de>2013-06-06 21:15:44 +0200
commit64d236c1a319d8bd3dc2742cd8e519aacab29df3 (patch)
tree06ebcce2be5c640f5603914a8f4da1e79d4159ee
parent5991bbeb417719663178ecf4ac283d8f538f48fd (diff)
downloadnumpy-64d236c1a319d8bd3dc2742cd8e519aacab29df3.tar.gz
Comment test cases
-rw-r--r--numpy/core/tests/test_numeric.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/numpy/core/tests/test_numeric.py b/numpy/core/tests/test_numeric.py
index 7cd0ea13c..ec13adde6 100644
--- a/numpy/core/tests/test_numeric.py
+++ b/numpy/core/tests/test_numeric.py
@@ -1339,23 +1339,27 @@ class TestCreationFuncs(TestCase):
fill_kwarg = {}
if fill_value is not None:
fill_kwarg = {'val': fill_value}
- for size in (0, 1, 2):
- for ndims in range(self.ndims):
+ for size in (0, 1, 2): # size in one dimension
+ for ndims in range(self.ndims): # [], [size], [size, size] etc.
shape = ndims * [size]
- for order in self.orders:
- for type in self.dtypes:
- for bytes in 2**np.arange(9):
+ for order in self.orders: # C, F
+ for type in self.dtypes: # bool, int, float etc.
+ for bytes in 2**np.arange(9): # byte size for type
try:
dtype = np.dtype('%s%d' % (type, bytes))
- except TypeError:
+ except TypeError: # dtype combination does not exist
continue
else:
+ # do not fill void type
if fill_value is not None and type == 'V':
continue
+
arr = func(shape, order=order, dtype=dtype,
**fill_kwarg)
+
assert arr.dtype == dtype
assert getattr(arr.flags, self.orders[order])
+
if fill_value is not None:
assert_equal(arr, dtype.type(fill_value))