Your at work your not in the playground anymore. You get paid to do a job so do it.
Just point out to him that his work is not a good enough standard and he needs to sort it. Tell him straight that if your asked about who did what you will make it clear that his crap pipe-work was nothing to do with you.
Team working only succeeds if all parties are heading for the same goal.
If its purely your standards are higher than his and it wont matter for the job then still tell him you dont think its acceptable and prefere to work with someone who takes pride in their job. If its a skill set problem then its only a matter of time before he gets found out anyway. He cant correct things if nobody tells him its wriong.
The problem at work today is nobody wants to upset anybody.
If keeping your job depends on the outcome of the quality of the work would you be happy to lose your job or would you speak out.
Be truthful and honest in all things and you will lead a good life.