(self)
| 4329 | # |
| 4330 | |
| 4331 | def buffer_like_objects(self): |
| 4332 | # Yield buffer-like objects with the bytestring "abcdef" in them |
| 4333 | bytestring = b"abcdefgh" |
| 4334 | yield ZeroCopyBytes(bytestring) |
| 4335 | yield ZeroCopyBytearray(bytestring) |
| 4336 | if _testbuffer is not None: |
| 4337 | items = list(bytestring) |
| 4338 | value = int.from_bytes(bytestring, byteorder='little') |
| 4339 | for flags in (0, _testbuffer.ND_WRITABLE): |
| 4340 | # 1-D, contiguous |
| 4341 | yield PicklableNDArray(items, format='B', shape=(8,), |
| 4342 | flags=flags) |
| 4343 | # 2-D, C-contiguous |
| 4344 | yield PicklableNDArray(items, format='B', shape=(4, 2), |
| 4345 | strides=(2, 1), flags=flags) |
| 4346 | # 2-D, Fortran-contiguous |
| 4347 | yield PicklableNDArray(items, format='B', |
| 4348 | shape=(4, 2), strides=(1, 4), |
| 4349 | flags=flags) |
| 4350 | |
| 4351 | def test_in_band_buffers(self): |
| 4352 | # Test in-band buffers (PEP 574) |
no test coverage detected