Amniocentesis is generally a diagnostic test performed between the 15th and 20th weeks of pregnancy.