(self)
| 1938 | lst=z.tolist()) |
| 1939 | |
| 1940 | def test_ndarray_random_invalid(self): |
| 1941 | # exceptions during construction of invalid arrays |
| 1942 | for _ in range(ITERATIONS): |
| 1943 | for fmt in fmtdict['@']: |
| 1944 | itemsize = struct.calcsize(fmt) |
| 1945 | |
| 1946 | t = rand_structure(itemsize, False, maxdim=MAXDIM, |
| 1947 | maxshape=MAXSHAPE) |
| 1948 | self.assertFalse(verify_structure(*t)) |
| 1949 | items = randitems_from_structure(fmt, t) |
| 1950 | |
| 1951 | nderr = False |
| 1952 | try: |
| 1953 | x = ndarray_from_structure(items, fmt, t) |
| 1954 | except Exception as e: |
| 1955 | nderr = e.__class__ |
| 1956 | self.assertTrue(nderr) |
| 1957 | |
| 1958 | if numpy_array: |
| 1959 | numpy_err = False |
| 1960 | try: |
| 1961 | y = numpy_array_from_structure(items, fmt, t) |
| 1962 | except Exception as e: |
| 1963 | numpy_err = e.__class__ |
| 1964 | |
| 1965 | if 0: # https://github.com/numpy/numpy/issues/2503 |
| 1966 | self.assertTrue(numpy_err) |
| 1967 | |
| 1968 | def test_ndarray_random_slice_assign(self): |
| 1969 | # valid slice assignments |
nothing calls this directly
no test coverage detected