Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/tests/util/test_assert_frame_equal.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def test_empty_dtypes(check_dtype):
df1["col1"] = df1["col1"].astype("int64")

if check_dtype:
msg = "Attributes are different"
msg = r"Attributes of DataFrame\..* are different"
with pytest.raises(AssertionError, match=msg):
assert_frame_equal(df1, df2, **kwargs)
else:
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/util/test_assert_series_equal.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def test_series_equal_values_mismatch(check_less_precise):


def test_series_equal_categorical_mismatch(check_categorical):
msg = """Attributes are different
msg = """Attributes of Series are different

Attribute "dtype" are different
\\[left\\]: CategoricalDtype\\(categories=\\['a', 'b'\\], ordered=False\\)
Expand Down
7 changes: 5 additions & 2 deletions pandas/util/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,9 @@ def assert_series_equal(
):
pass
else:
assert_attr_equal("dtype", left, right)
assert_attr_equal(
"dtype", left, right, obj="Attributes of {obj}".format(obj=obj)
)

if check_exact:
assert_numpy_array_equal(
Expand Down Expand Up @@ -1315,8 +1317,9 @@ def assert_frame_equal(

>>> assert_frame_equal(df1, df2)
Traceback (most recent call last):
AssertionError: Attributes are different
...
AssertionError: Attributes of DataFrame.iloc[:, 1] are different

Attribute "dtype" are different
[left]: int64
[right]: float64
Expand Down