How soon can you find out if you’re pregnant?

How soon can a doctor know if you’re pregnant through a pee test?