UTI and antibiotics

I get frequent urinary tract infections. My doctor has me on auto refill for antibiotics for them because I can always feel one coming on. Well I haven’t had one in a month or two but I’m starting to feel one coming on. However, I might be pregnant and can’t test until next Friday. My question is, can I take the antibiotic if I’m possibly pregnant?