Pregnancy?!

How long you should wait after having sex to do a pregnancy test i just want to check i dont think i am but i want to make sure he used a condom but he changed and all that i just would like to see if an oops didnt happen