(strategy, attrs, expected, error)
| 779 | ), |
| 780 | ) |
| 781 | def test_keep_attrs_strategies_variable(strategy, attrs, expected, error) -> None: |
| 782 | a = xr.Variable("x", [0, 1], attrs=attrs[0]) |
| 783 | b = xr.Variable("x", [0, 1], attrs=attrs[1]) |
| 784 | c = xr.Variable("x", [0, 1], attrs=attrs[2]) |
| 785 | |
| 786 | if error: |
| 787 | with pytest.raises(xr.MergeError): |
| 788 | apply_ufunc(lambda *args: sum(args), a, b, c, keep_attrs=strategy) |
| 789 | else: |
| 790 | expected = xr.Variable("x", [0, 3], attrs=expected) |
| 791 | actual = apply_ufunc(lambda *args: sum(args), a, b, c, keep_attrs=strategy) |
| 792 | |
| 793 | assert_identical(actual, expected) |
| 794 | |
| 795 | |
| 796 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected
searching dependent graphs…