From 86db88798345e700dd6d5c5283aa7b15a8f54e33 Mon Sep 17 00:00:00 2001 From: Tobias Grigo Date: Thu, 7 Nov 2024 14:53:52 +0100 Subject: [PATCH] Future proof the pulp_file repair tests for python 3.11 This change unblocks the functional pulp_file repair tests when run on a python 3.11+ environment. Stronger typing for the random.sample function is introduced in 3.11 and requires now a Sequence type as an input or it will throw a TypeError. see: https://docs.python.org/3.11/library/random.html#random.sample [noissue] (cherry picked from commit 6b8e291d22d3bb61d42c4dbd7437951aa40d1f2b) --- pulpcore/tests/functional/api/using_plugin/test_repair.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulpcore/tests/functional/api/using_plugin/test_repair.py b/pulpcore/tests/functional/api/using_plugin/test_repair.py index e6a14740c4..63e632872a 100644 --- a/pulpcore/tests/functional/api/using_plugin/test_repair.py +++ b/pulpcore/tests/functional/api/using_plugin/test_repair.py @@ -25,7 +25,7 @@ def repository_with_corrupted_artifacts( repo = file_bindings.RepositoriesFileApi.read(file_repo.pulp_href) # STEP 2: sample artifacts that will be modified on the filesystem later on - content1, content2 = sample(get_files_in_manifest(remote.url), 2) + content1, content2 = sample(list(get_files_in_manifest(remote.url)), 2) # Modify an artifact artifact1_path = artifacts_api_client.list(sha256=content1[1]).results[0].file