(self, casting)
| 1989 | |
| 1990 | @pytest.mark.parametrize("casting", [None, "unsafe"]) |
| 1991 | def test_simple_int32_inout(self, casting): |
| 1992 | # Test native int32 input with double min/max and int32 out. |
| 1993 | a = self._generate_int32_data(self.nr, self.nc) |
| 1994 | m = np.float64(0) |
| 1995 | M = np.float64(2) |
| 1996 | ac = np.zeros(a.shape, dtype=np.int32) |
| 1997 | act = ac.copy() |
| 1998 | if casting is None: |
| 1999 | with pytest.raises(TypeError): |
| 2000 | self.fastclip(a, m, M, ac, casting=casting) |
| 2001 | else: |
| 2002 | # explicitly passing "unsafe" will silence warning |
| 2003 | self.fastclip(a, m, M, ac, casting=casting) |
| 2004 | self.clip(a, m, M, act) |
| 2005 | assert_array_strict_equal(ac, act) |
| 2006 | |
| 2007 | def test_simple_int64_out(self): |
| 2008 | # Test native int32 input with int32 scalar min/max and int64 out. |
nothing calls this directly
no test coverage detected