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..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.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': {