Skip to content

Commit 6b9cd15

Browse files
sinhrksjreback
authored andcommitted
TST: assert message shows unnecessary diff (#13676)
1 parent ada6bf3 commit 6b9cd15

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pandas/util/testing.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1010,14 +1010,15 @@ def raise_assert_detail(obj, message, left, right, diff=None):
10101010
if isinstance(right, np.ndarray):
10111011
right = pprint_thing(right)
10121012

1013-
if diff is not None:
1014-
diff = "\n[diff]: {diff}".format(diff=diff)
1015-
10161013
msg = """{0} are different
10171014
10181015
{1}
10191016
[left]: {2}
1020-
[right]: {3}{4}""".format(obj, message, left, right, diff)
1017+
[right]: {3}""".format(obj, message, left, right)
1018+
1019+
if diff is not None:
1020+
msg = msg + "\n[diff]: {diff}".format(diff=diff)
1021+
10211022
raise AssertionError(msg)
10221023

10231024

0 commit comments

Comments
 (0)