def METHOD_NAME(self, dtype):
    for xp in (numpy, cupy):
        a = testing.shaped_random((0,), xp, dtype)
        with pytest.raises(ValueError):
            xp.polynomial.polyutils.trimcoef(a, -1e-3)