Could I be pregnant??

I am on the pill, but knowing it’s not 100% still worries me. I’ve been feeling kind of nauseous recently and I think I’ve gained some weight. I went to the doctor a few days ago for a UTI and they took a urine test. If I was pregnant would that show up? And if so, how long would it take to show up??