()
| 27 | |
| 28 | |
| 29 | def test_object_comparison_2d(): |
| 30 | left = np.arange(9).reshape(3, 3).astype(object) |
| 31 | right = left.T |
| 32 | |
| 33 | result = comparison_op(left, right, operator.eq) |
| 34 | expected = np.eye(3).astype(bool) |
| 35 | tm.assert_numpy_array_equal(result, expected) |
| 36 | |
| 37 | # Ensure that cython doesn't raise on non-writeable arg, which |
| 38 | # we can get from np.broadcast_to |
| 39 | right.flags.writeable = False |
| 40 | result = comparison_op(left, right, operator.ne) |
| 41 | tm.assert_numpy_array_equal(result, ~expected) |
| 42 | |
| 43 | |
| 44 | @pytest.mark.parametrize("rvalues", [1, [1, 1, 1], np.nan, None]) |
nothing calls this directly
no test coverage detected