tests: Fix mocking of sleep calls with tenacity 8.4.2
Latest tenacity release adds some internal changes that broke the mocking of sleep calls in tests. Fix it by directly mocking time.sleep (was not working previously).
This commit is contained in:
parent
323e277482
commit
a7607abcf9
15 changed files with 30 additions and 79 deletions
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2017-2023 The Software Heritage developers
|
||||
# Copyright (C) 2017-2024 The Software Heritage developers
|
||||
# See the AUTHORS file at the top-level directory of this distribution
|
||||
# License: GNU General Public License version 3, or any later version
|
||||
# See top-level LICENSE file for more information
|
||||
|
@ -109,8 +109,6 @@ def test_bitbucket_lister_rate_limit_hit(
|
|||
|
||||
lister = BitbucketLister(scheduler=swh_scheduler, page_size=10)
|
||||
|
||||
mocker.patch.object(lister.http_request.retry, "sleep")
|
||||
|
||||
stats = lister.run()
|
||||
|
||||
assert stats.pages == 2
|
||||
|
@ -200,8 +198,6 @@ def test_bitbucket_lister_buggy_page(
|
|||
|
||||
lister = BitbucketLister(scheduler=swh_scheduler, page_size=10)
|
||||
|
||||
mocker.patch.object(lister.http_request.retry, "sleep")
|
||||
|
||||
stats = lister.run()
|
||||
|
||||
assert stats.pages == 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue