This is another style issue (and you can see the existing test code isn't great at this), but in general I would rather not make global variables. It's more self-contained and obvious. In this case, you could simply move `_attrs` to inside `test_reduce_keep_attrs`.