Doctor telling me I’m pregnant

So my period is late but I went to the doctor a few days ago for a health reason that has nothing to do w my period and I had to owe in a cup and they like tested it they would tell me if I was pregnant right