From 33925e7ad0e85ba3a1649b457e7d0b3c2ef34afe Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 14 Dec 2023 15:08:37 +0000 Subject: [PATCH] Remove duplicated function(and pytest helper) Signed-off-by: Pedro Algarvio --- tests/support/pkg.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/tests/support/pkg.py b/tests/support/pkg.py index 2f270f433c7d..eaf28eb4a3b3 100644 --- a/tests/support/pkg.py +++ b/tests/support/pkg.py @@ -31,7 +31,7 @@ import salt.utils.files from tests.conftest import CODE_DIR -from tests.support.pytest.helpers import TestAccount +from tests.support.pytest.helpers import TestAccount, download_file ARTIFACTS_DIR = CODE_DIR / "artifacts" / "pkg" @@ -1494,15 +1494,3 @@ def __enter__(self): def __exit__(self, *args): self.session.__exit__(*args) - - -@pytest.helpers.register -def download_file(url, dest, auth=None): - # NOTE the stream=True parameter below - with requests.get(url, stream=True, auth=auth) as r: - r.raise_for_status() - with salt.utils.files.fopen(dest, "wb") as f: - for chunk in r.iter_content(chunk_size=8192): - if chunk: - f.write(chunk) - return dest