diff --git a/tests/test_rfc2737.py b/tests/test_rfc2737.py index 81188f27b..2d7e86421 100644 --- a/tests/test_rfc2737.py +++ b/tests/test_rfc2737.py @@ -98,7 +98,7 @@ def test_PhysicalTableMIBUpdater_runtime_exc_in_reinit_data_wont_block_reinit_it def test_PhysicalTableMIBUpdater_runtime_exc_in_reinit_data_wont_block_reinit_iteration_last(self, mock_xcvr_reinit_data): updater = PhysicalTableMIBUpdater() - with (pytest.raises(RuntimeError) as excinfo, + with (pytest.raises(RuntimeError, match='mocked runtime error1'), mock.patch('sonic_ax_impl.mibs.ietf.rfc2737.XcvrCacheUpdater.reinit_data') as mocked_xcvr_reinit_data, mock.patch('sonic_ax_impl.mibs.ietf.rfc2737.PsuCacheUpdater.reinit_data') as mocked_psu_reinit_data, mock.patch('sonic_ax_impl.mibs.ietf.rfc2737.FanDrawerCacheUpdater.reinit_data') as mocked_fan_drawer_reinit_data, @@ -112,7 +112,6 @@ def test_PhysicalTableMIBUpdater_runtime_exc_in_reinit_data_wont_block_reinit_it mocked_fan_cache_reinit_data.assert_called() mocked_thermal_reinit_data.assert_called() mocked_cancel_redis_pubsub.assert_called() - assert str(excinfo.value) == "mocked runtime error" # Given: 5 physical updaters are register into reinit of PhysicalTableMIBUpdater # When: The first(XcvrCacheUpdater) and last updater(ThermalCacheUpdater)