@@ -215,24 +215,15 @@ def test_series_equal_numeric_values_mismatch(rtol):
215215
216216
217217def test_series_equal_categorical_values_mismatch (rtol , using_infer_string ):
218- if using_infer_string :
219- msg = """Series are different
220-
221- Series values are different \\ (66\\ .66667 %\\ )
222- \\ [index\\ ]: \\ [0, 1, 2\\ ]
223- \\ [left\\ ]: \\ ['a', 'b', 'c'\\ ]
224- Categories \\ (3, str\\ ): \\ [a, b, c\\ ]
225- \\ [right\\ ]: \\ ['a', 'c', 'b'\\ ]
226- Categories \\ (3, str\\ ): \\ [a, b, c\\ ]"""
227- else :
228- msg = """Series are different
218+ dtype = "str" if using_infer_string else "object"
219+ msg = f"""Series are different
229220
230221Series values are different \\ (66\\ .66667 %\\ )
231222\\ [index\\ ]: \\ [0, 1, 2\\ ]
232223\\ [left\\ ]: \\ ['a', 'b', 'c'\\ ]
233- Categories \\ (3, object \\ ): \\ ['a', 'b', 'c'\\ ]
224+ Categories \\ (3, { dtype } \\ ): \\ ['a', 'b', 'c'\\ ]
234225\\ [right\\ ]: \\ ['a', 'c', 'b'\\ ]
235- Categories \\ (3, object \\ ): \\ ['a', 'b', 'c'\\ ]"""
226+ Categories \\ (3, { dtype } \\ ): \\ ['a', 'b', 'c'\\ ]"""
236227
237228 s1 = Series (Categorical (["a" , "b" , "c" ]))
238229 s2 = Series (Categorical (["a" , "c" , "b" ]))
0 commit comments