(self, function, args, kwargs)
| 689 | |
| 690 | @pytest.mark.parametrize('function, args, kwargs', _array_tests) |
| 691 | def test_like_as_none(self, function, args, kwargs): |
| 692 | self.add_method('array', self.MyArray) |
| 693 | self.add_method(function, self.MyArray) |
| 694 | np_func = getattr(np, function) |
| 695 | |
| 696 | like_args = tuple(a() if callable(a) else a for a in args) |
| 697 | # required for loadtxt and genfromtxt to init w/o error. |
| 698 | like_args_exp = tuple(a() if callable(a) else a for a in args) |
| 699 | |
| 700 | array_like = np_func(*like_args, **kwargs, like=None) |
| 701 | expected = np_func(*like_args_exp, **kwargs) |
| 702 | # Special-case np.empty to ensure values match |
| 703 | if function == "empty": |
| 704 | array_like.fill(1) |
| 705 | expected.fill(1) |
| 706 | assert_equal(array_like, expected) |
| 707 | |
| 708 | |
| 709 | def test_function_like(): |
nothing calls this directly
no test coverage detected