I get what you're trying to do, but it would probably be cleaner to use the assert_attr_equal function from pandas/util/testing

```python
def _two_values_same_attributes(self, a, b, attrs):
    for attr in attrs:
        assert_attr_equal(attr, a, b)
```

That way you'll get an error message that specifies exactly which attribute is off.  If you want to collect them, you could run through the attrs first and then raise an error at the end:

```python
    non_equal = [attr for attr in attrs if getattr(a, attr) != getattr(b, attr)]
    if non_equal:
        raise AssertionError("Attributes not equal: %r for objects %s and %s" % (attrs, a, b))
```

The error code part is just hard to debug.