sourceforge/tests: Ensure correct sleep function gets mocked
This ensures the mocked sleep will work with all tenacity versions. Related to T3310
This commit is contained in:
parent
1284eb1587
commit
3167a6dcb7
1 changed files with 3 additions and 2 deletions
|
@ -273,11 +273,12 @@ def test_sourceforge_lister_incremental(swh_scheduler, requests_mock, datadir, m
|
|||
|
||||
|
||||
def test_sourceforge_lister_retry(swh_scheduler, requests_mock, mocker, datadir):
|
||||
# Exponential retries take a long time, so stub time.sleep
|
||||
mocked_sleep = mocker.patch("time.sleep", return_value=None)
|
||||
|
||||
lister = SourceForgeLister(scheduler=swh_scheduler)
|
||||
|
||||
# Exponential retries take a long time, so stub time.sleep
|
||||
mocked_sleep = mocker.patch.object(lister.page_request.retry, "sleep")
|
||||
|
||||
requests_mock.get(
|
||||
MAIN_SITEMAP_URL,
|
||||
[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue