Use assert_throws for tests of this nature.