Update tests to check for ValueError instead