A pregnancy test is a test that determines whether or not a woman is pregnant. There are two main types of pregnancy tests: urine and blood tests. Pregnancy tests work by detecting levels of the hormone called human chorionic gonadotropin (hCG), which is a hormone that is produced when a fertilized egg attaches to the wall of a woman's uterus.