conftest: Use proper way to mock sleep from tenacity retry

This fixes tests hang when building package for debian buster.
This commit is contained in:
Antoine Lambert 2023-07-04 17:30:38 +02:00
parent 8d7dccc54a
commit 87d2344c60

View file

@ -15,4 +15,6 @@ os.environ["LC_ALL"] = "C.UTF-8"
@pytest.fixture(autouse=True)
def tenacity_wait(mocker):
# Stops tenacity from blocking lister tests for 50x errors
mocker.patch("tenacity.nap.time")
from swh.lister.pattern import Lister
mocker.patch.object(Lister.http_request.retry, "sleep")