Can contractible subspace be ignored/collapsed when computing $\pi_n$ or $H_n$? Can contractible subspace be ignored/collapsed when computing $\pi_n$ or $H_n$?
Motivation: I took this for granted for a long time, as I thought collapsing the contractible subspace does not change the homotopy type. Now it seems that this is only true for a CW pair... 
 A: Yes, you need a hypothesis like being a CW pair. A more general condition you could impose is that the inclusion of the contractible subspace is a cofibration.
For an example of why this is necessary, consider $X = S^1$ and $A = X\setminus\{\ast\}$. Then collapsing A gives you a two-point space which is contractible. There are several ways to see the contractibility of this space, one is that this space is the non-Hausdorff cone over a point.
A: Let me note a general fact: if the inclusion $A \hookrightarrow X$ (for $A$ a closed subspace) is a cofibration, and $A$ is contractible, then the map $X \to X/A$ is a homotopy equivalence. See Corollary 5.13 in chapter 1 of Whitehead's "Elements of homotopy theory."
A: You are right. An interesting example of this kind of behavior consists of taking two copies of the Hawaiian Earring space and connecting their basepoints by a line segment. Contracting the middle segment gives you the standard Hawaiian Earrings. However this contraction is not a homotopy equivalence! The fundamental groups are different!
