From 127d16ced0f237fd7680f2615e2eed69b019fa51 Mon Sep 17 00:00:00 2001 From: Shunping Huang Date: Fri, 12 Dec 2025 13:40:56 -0500 Subject: [PATCH] Sort the results before assertion --- .../snippets/transforms/elementwise/enrichment_test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py b/sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py index ed2b0c131e0c..0b356e039930 100644 --- a/sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py +++ b/sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py @@ -177,7 +177,7 @@ def test_enrichment_with_google_cloudsql_pg(self, mock_stdout): enrichment_with_google_cloudsql_pg() output = mock_stdout.getvalue().splitlines() expected = validate_enrichment_with_google_cloudsql_pg() - self.assertEqual(output, expected) + self.assertEqual(sorted(output), sorted(expected)) except Exception as e: self.fail(f"Test failed with unexpected error: {e}") @@ -188,7 +188,7 @@ def test_enrichment_with_external_pg(self, mock_stdout): enrichment_with_external_pg() output = mock_stdout.getvalue().splitlines() expected = validate_enrichment_with_external_pg() - self.assertEqual(output, expected) + self.assertEqual(sorted(output), sorted(expected)) except (TestContainerStartupError, TestContainerTeardownError) as e: raise unittest.SkipTest(str(e)) except Exception as e: @@ -201,7 +201,7 @@ def test_enrichment_with_external_mysql(self, mock_stdout): enrichment_with_external_mysql() output = mock_stdout.getvalue().splitlines() expected = validate_enrichment_with_external_mysql() - self.assertEqual(output, expected) + self.assertEqual(sorted(output), sorted(expected)) except (TestContainerStartupError, TestContainerTeardownError) as e: raise unittest.SkipTest(str(e)) except Exception as e: @@ -214,7 +214,7 @@ def test_enrichment_with_external_sqlserver(self, mock_stdout): enrichment_with_external_sqlserver() output = mock_stdout.getvalue().splitlines() expected = validate_enrichment_with_external_sqlserver() - self.assertEqual(output, expected) + self.assertEqual(sorted(output), sorted(expected)) except (TestContainerStartupError, TestContainerTeardownError) as e: raise unittest.SkipTest(str(e)) except Exception as e: