(self, func, fill_value=None)
| 2726 | self.ndims = 10 |
| 2727 | |
| 2728 | def check_function(self, func, fill_value=None): |
| 2729 | par = ((0, 1, 2), |
| 2730 | range(self.ndims), |
| 2731 | self.orders, |
| 2732 | self.dtypes) |
| 2733 | fill_kwarg = {} |
| 2734 | if fill_value is not None: |
| 2735 | fill_kwarg = {'fill_value': fill_value} |
| 2736 | |
| 2737 | for size, ndims, order, dtype in itertools.product(*par): |
| 2738 | shape = ndims * [size] |
| 2739 | |
| 2740 | # do not fill void type |
| 2741 | if fill_kwarg and dtype.str.startswith('|V'): |
| 2742 | continue |
| 2743 | |
| 2744 | arr = func(shape, order=order, dtype=dtype, |
| 2745 | **fill_kwarg) |
| 2746 | |
| 2747 | assert_equal(arr.dtype, dtype) |
| 2748 | assert_(getattr(arr.flags, self.orders[order])) |
| 2749 | |
| 2750 | if fill_value is not None: |
| 2751 | if dtype.str.startswith('|S'): |
| 2752 | val = str(fill_value) |
| 2753 | else: |
| 2754 | val = fill_value |
| 2755 | assert_equal(arr, dtype.type(val)) |
| 2756 | |
| 2757 | def test_zeros(self): |
| 2758 | self.check_function(np.zeros) |
no test coverage detected