Hrm... In fact, I think I would just leave this clause out, and just let the attribute error propagate, and let that fail the test. Your failure message isn't really adding any new information that the stack trace wouldn't give you.