How soon?

How soon can you take a pregnancy test and it be accurate?