From 28cd97027ba20ec75fa88b11d68e01089256cd71 Mon Sep 17 00:00:00 2001 From: Jonathan Walker Date: Thu, 29 Aug 2024 10:37:02 -0400 Subject: [PATCH] test: rest mock --- tests/unit/test_pageiterator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit/test_pageiterator.py b/tests/unit/test_pageiterator.py index 156f8b6d..68c85c31 100644 --- a/tests/unit/test_pageiterator.py +++ b/tests/unit/test_pageiterator.py @@ -65,6 +65,10 @@ def test_no_paging_required(): obj = RestObj(items=items, count=len(items)) with mock.patch("sasctl.core.request") as req: + # Mock appears to be *sometimes* shared with mock created in `paging` fixture + # above. Depending on execution order, this can result in calls to the mock + # made by other tests to be counted here. Explicitly reset to prevent this. + req.reset_mock() pager = PageIterator(obj) # Returned page of items should preserve item order