Blood tests before marriage?

I was recently watching “The Graduate,” and after asking the girl to marry him, Dustin Hoffman’s character said they would need to get a blood test. I vaugely remember hearing somethign like that in another context as well.
Is there a law enforcing this? What are they testing for?