def assert_attributes(a, b, *attrs):
for attr in attrs:<EOL><INDENT>x = getattr(a, attr, None)<EOL>y = getattr(b, attr, None)<EOL>if isinstance(x, numpy.ndarray) and isinstance(b, numpy.ndarray):<EOL><INDENT>assert_array_equal(x, y)<EOL><DEDENT>else:<EOL><INDENT>assert x == y<EOL><DEDENT><DEDENT>
Assert that the attributes for two objects match

    `attrs` should be `list` of attribute names that can be accessed
    with `getattr`