()
| 617 | |
| 618 | |
| 619 | def test_writeable_memoryview(): |
| 620 | # The result of broadcast_arrays exports as a non-writeable memoryview |
| 621 | # because otherwise there is no good way to opt in to the new behaviour |
| 622 | # (i.e. you would need to set writeable to False explicitly). |
| 623 | # See gh-13929. |
| 624 | original = np.array([1, 2, 3]) |
| 625 | |
| 626 | for is_broadcast, results in [(False, broadcast_arrays(original,)), |
| 627 | (True, broadcast_arrays(0, original))]: |
| 628 | for result in results: |
| 629 | # This will change to False in a future version |
| 630 | if is_broadcast: |
| 631 | # memoryview(result, writable=True) will give warning but cannot |
| 632 | # be tested using the python API. |
| 633 | assert memoryview(result).readonly |
| 634 | else: |
| 635 | assert not memoryview(result).readonly |
| 636 | |
| 637 | |
| 638 | def test_reference_types(): |
nothing calls this directly
no test coverage detected