gyno question

At the gynecologist when you pee in a cup they check for pregnancy right? And if you were pregnant would they tell you?