Is Cauchy-Riemann a necessary or sufficient condition?

When integrating using the method of residues, one needs to check if the integrand satisfies the Cauchy-Riemann equations first.

However, it is possible to have an integral that doesn't satisfy Cauchy-Riemann and yet the method of residues still works! To see an example of such an integral, see the Appendix of this document: