I farm with my friend tried to farm the infinity pistol over 20 times the infinity pistol and we got nothing
That is not uncommon. The 1-in-10 odds mean you could just as easily get 2 back to back as 20 dry runs. Keep at it and you will get one. If you want to know more, there’s a guide on the subject.
Also make sure your game is updated
Doc Mercy is notoriously stingy. A lot of folks have beaten their head against that wall for a really long time. I’ve gotten more Infinity pistols on the peak than from his “natural” spawn. Just keep at it, eventually RNGsus will roll in your favor.