From 02d8d3fce8b1e54e679c00f05f7a903f85dc98e6 Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Mon, 1 Jul 2024 20:30:05 +0100 Subject: [PATCH] Modify test code to be less brittle The test for log function against ObjectRetrierWraps class is too brittle to the number of log calls. This commit makes it less brittle. --- unit_tests/utilities/test_utilities.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/unit_tests/utilities/test_utilities.py b/unit_tests/utilities/test_utilities.py index 2f6dcf6e3..7eb99276d 100644 --- a/unit_tests/utilities/test_utilities.py +++ b/unit_tests/utilities/test_utilities.py @@ -150,9 +150,7 @@ def func(self): with self.assertRaises(SomeException): wrapped_a.func() - # there should be two calls; one for the single retry and one for the - # failure. - self.assertEqual(mock_log.call_count, 6) + mock_log.assert_called() @mock.patch("time.sleep") def test_back_off_maximum(self, mock_sleep):