diff --git a/test/test_pytato.py b/test/test_pytato.py
index 4ace4f3ed60664fb5c115bb35bafb16cd6732b8e..98393b95bedb40d5b6fafc4157dcb11fbb65285d 100644
--- a/test/test_pytato.py
+++ b/test/test_pytato.py
@@ -451,8 +451,8 @@ def test_array_dot_repr():
     y = pt.make_placeholder("y", (10, 4), np.int64)
 
     def _assert_stripped_repr(ary: pt.Array, expected_repr: str):
-        expected_str = "".join([c for c in repr(ary) if c not in [" ", "\n"]])
-        result_str = "".join([c for c in expected_repr if c not in [" ", "\n"]])
+        expected_str = "".join([c for c in expected_repr if c not in [" ", "\n"]])
+        result_str = "".join([c for c in repr(ary)if c not in [" ", "\n"]])
         assert expected_str == result_str
 
     _assert_stripped_repr(