In Ron Gordon's answer here, he uses the residue theorem to compute the sum $$\sum_{k=-\infty}^{\infty} \frac{(-1)^{k} (2 k-1)}{k^2-k+1}$$
The theorem for the case of infinite sums states that
Let $f : \mathbb C \mapsto \mathbb C$ be holomorphic on $\mathbb C$ except for finitely many points $p_1, p_2, \dots, p_k$ (which are usually poles), none of which are real integers. Suppose that there exists some $M, R>0$ such that $\left|z^2 f(z)\right| \le M$ is bounded $\forall |z| > R$. If $\forall z$ we let $g(z) = \pi \cot(\pi z) f(z)$ and $h(z) = \pi \csc(\pi z) f(z)$, then $$\sum_{n\in \mathbb Z} f(n) = -\sum_{j=1}^k \mathop{\mathrm{Res}}_{z = p_j} g(z) \quad\text{and}\quad \sum_{n\in \mathbb Z} (-1)^n f(n) = -\sum_{j=1}^k \mathop{\mathrm{Res}}_{z = p_j} h(z)$$
In our case here, $f(x) = \frac{2x-1}{x^{2}-x+1} $, and it is very obvious that $\left|\frac{2x^3-x^2}{x^{2}-x+1}\right|$ is not bounded, but instead grows asymptotically with $\mathcal O(x)$.
Despite this condition not being satisfied (which is the condition that makes the contour integral go to $0$, see the proof and theorem here and here on page 206), the result is still correct.
Why is this? Is there anything I am missing (such as the contour integral going to $0$ regardless from something else)?
Help is appreciated much thanks :) Max0815