From d71dd0ba60dc2819c662ade2899e6db5a311bad0 Mon Sep 17 00:00:00 2001 From: Valentyn Tymofieiev Date: Thu, 9 May 2024 15:51:07 -0700 Subject: [PATCH 1/2] Remove a deprecated test helper. --- sdks/python/apache_beam/options/pipeline_options_test.py | 4 ++-- sdks/python/apache_beam/testing/test_pipeline_test.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdks/python/apache_beam/options/pipeline_options_test.py b/sdks/python/apache_beam/options/pipeline_options_test.py index c7a56b4739bd..61b227d9a246 100644 --- a/sdks/python/apache_beam/options/pipeline_options_test.py +++ b/sdks/python/apache_beam/options/pipeline_options_test.py @@ -205,7 +205,7 @@ def test_display_data(self, flags, _, display_data): @parameterized.expand(TEST_CASES) def test_get_all_options_subclass(self, flags, expected, _): options = PipelineOptionsTest.MockOptions(flags=flags) - self.assertDictContainsSubset(expected, options.get_all_options()) + self.assertLessEqual(expected.items(), options.get_all_options().items()) self.assertEqual( options.view_as(PipelineOptionsTest.MockOptions).mock_flag, expected['mock_flag']) @@ -219,7 +219,7 @@ def test_get_all_options_subclass(self, flags, expected, _): @parameterized.expand(TEST_CASES) def test_get_all_options(self, flags, expected, _): options = PipelineOptions(flags=flags) - self.assertDictContainsSubset(expected, options.get_all_options()) + self.assertLessEqual(expected.items(), options.get_all_options().items()) self.assertEqual( options.view_as(PipelineOptionsTest.MockOptions).mock_flag, expected['mock_flag']) diff --git a/sdks/python/apache_beam/testing/test_pipeline_test.py b/sdks/python/apache_beam/testing/test_pipeline_test.py index c38b802dc90c..a4e76012e891 100644 --- a/sdks/python/apache_beam/testing/test_pipeline_test.py +++ b/sdks/python/apache_beam/testing/test_pipeline_test.py @@ -68,8 +68,8 @@ def test_empty_option_args_parsing(self): def test_create_test_pipeline_options(self): test_pipeline = TestPipeline(argv=self.TEST_CASE['options']) test_options = PipelineOptions(test_pipeline.get_full_options_as_args()) - self.assertDictContainsSubset( - self.TEST_CASE['expected_dict'], test_options.get_all_options()) + self.assertLessEqual(self.TEST_CASE['expected_dict'].items(), + test_options.get_all_options().items()) EXTRA_OPT_CASES = [{ 'options': { From b91cc5ec60cddfed4ccf9e6fb8086dc3967b137d Mon Sep 17 00:00:00 2001 From: Valentyn Tymofieiev Date: Thu, 9 May 2024 16:25:33 -0700 Subject: [PATCH 2/2] yapf --- sdks/python/apache_beam/testing/test_pipeline_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sdks/python/apache_beam/testing/test_pipeline_test.py b/sdks/python/apache_beam/testing/test_pipeline_test.py index a4e76012e891..06946c7a7efb 100644 --- a/sdks/python/apache_beam/testing/test_pipeline_test.py +++ b/sdks/python/apache_beam/testing/test_pipeline_test.py @@ -68,8 +68,9 @@ def test_empty_option_args_parsing(self): def test_create_test_pipeline_options(self): test_pipeline = TestPipeline(argv=self.TEST_CASE['options']) test_options = PipelineOptions(test_pipeline.get_full_options_as_args()) - self.assertLessEqual(self.TEST_CASE['expected_dict'].items(), - test_options.get_all_options().items()) + self.assertLessEqual( + self.TEST_CASE['expected_dict'].items(), + test_options.get_all_options().items()) EXTRA_OPT_CASES = [{ 'options': {