Adds a pragma no cover for a except in a unittest