TST: add #pragma: no cover for python version branches

Remove unused code.