replace raises with assert_raises