From 39bc4d3551be48892ce7b7d51bb8cda940e7426e Mon Sep 17 00:00:00 2001 From: Ahmet Altay Date: Thu, 16 Jul 2020 17:05:48 -0700 Subject: [PATCH] Relax to matchers to match display data from the specific tests, not from all options. --- sdks/python/apache_beam/transforms/display_test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdks/python/apache_beam/transforms/display_test.py b/sdks/python/apache_beam/transforms/display_test.py index 7d67c556eb74..840fc6d581bd 100644 --- a/sdks/python/apache_beam/transforms/display_test.py +++ b/sdks/python/apache_beam/transforms/display_test.py @@ -151,7 +151,7 @@ def _add_argparse_args(cls, parser): 'RuntimeValueProvider(option: float_flag,' ' type: float, default_value: None)') ] - hc.assert_that(items, hc.contains_inanyorder(*expected_items)) + hc.assert_that(items, hc.has_items(*expected_items)) def test_create_list_display_data(self): flags = ['--extra_package', 'package1', '--extra_package', 'package2'] @@ -159,7 +159,7 @@ def test_create_list_display_data(self): items = DisplayData.create_from_options(pipeline_options).items hc.assert_that( items, - hc.contains_inanyorder( + hc.has_items( DisplayDataItemMatcher( 'extra_packages', str(['package1', 'package2'])))) @@ -219,7 +219,7 @@ def display_data(self): key='static_string', value='static me!', namespace=nspace) ] - hc.assert_that(dd.items, hc.contains_inanyorder(*expected_items)) + hc.assert_that(dd.items, hc.has_items(*expected_items)) def test_drop_if_none(self): class MyDoFn(beam.DoFn): @@ -236,7 +236,7 @@ def display_data(self): DisplayDataItemMatcher('some_val', 'something'), DisplayDataItemMatcher('nodef_val', True) ] - hc.assert_that(dd.items, hc.contains_inanyorder(*expected_items)) + hc.assert_that(dd.items, hc.has_items(*expected_items)) def test_subcomponent(self): class SpecialDoFn(beam.DoFn): @@ -253,7 +253,7 @@ def display_data(self): DisplayDataItemMatcher('fn', SpecialDoFn, pardo_nspace) ] - hc.assert_that(dd.items, hc.contains_inanyorder(*expected_items)) + hc.assert_that(dd.items, hc.has_items(*expected_items)) # TODO: Test __repr__ function