Skip to content

Commit 31a96b6

Browse files
authored
Sort the results before assertion (#37097)
1 parent 8a4a69e commit 31a96b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def test_enrichment_with_google_cloudsql_pg(self, mock_stdout):
177177
enrichment_with_google_cloudsql_pg()
178178
output = mock_stdout.getvalue().splitlines()
179179
expected = validate_enrichment_with_google_cloudsql_pg()
180-
self.assertEqual(output, expected)
180+
self.assertEqual(sorted(output), sorted(expected))
181181
except Exception as e:
182182
self.fail(f"Test failed with unexpected error: {e}")
183183

@@ -188,7 +188,7 @@ def test_enrichment_with_external_pg(self, mock_stdout):
188188
enrichment_with_external_pg()
189189
output = mock_stdout.getvalue().splitlines()
190190
expected = validate_enrichment_with_external_pg()
191-
self.assertEqual(output, expected)
191+
self.assertEqual(sorted(output), sorted(expected))
192192
except (TestContainerStartupError, TestContainerTeardownError) as e:
193193
raise unittest.SkipTest(str(e))
194194
except Exception as e:
@@ -201,7 +201,7 @@ def test_enrichment_with_external_mysql(self, mock_stdout):
201201
enrichment_with_external_mysql()
202202
output = mock_stdout.getvalue().splitlines()
203203
expected = validate_enrichment_with_external_mysql()
204-
self.assertEqual(output, expected)
204+
self.assertEqual(sorted(output), sorted(expected))
205205
except (TestContainerStartupError, TestContainerTeardownError) as e:
206206
raise unittest.SkipTest(str(e))
207207
except Exception as e:
@@ -214,7 +214,7 @@ def test_enrichment_with_external_sqlserver(self, mock_stdout):
214214
enrichment_with_external_sqlserver()
215215
output = mock_stdout.getvalue().splitlines()
216216
expected = validate_enrichment_with_external_sqlserver()
217-
self.assertEqual(output, expected)
217+
self.assertEqual(sorted(output), sorted(expected))
218218
except (TestContainerStartupError, TestContainerTeardownError) as e:
219219
raise unittest.SkipTest(str(e))
220220
except Exception as e:

0 commit comments

Comments
 (0)