From 491e0b313739fda403c451b82879d79f04ff233a Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Thu, 20 Apr 2023 21:21:44 +0000 Subject: [PATCH] backport PR to replace a mock import Mock is deprecated in Fedora. --- Replace-mock-import-with-compat.mock.patch | 28 ++++++++++++++++++++++ ansible-core.spec | 1 + 2 files changed, 29 insertions(+) create mode 100644 Replace-mock-import-with-compat.mock.patch diff --git a/Replace-mock-import-with-compat.mock.patch b/Replace-mock-import-with-compat.mock.patch new file mode 100644 index 0000000..7d6e7a1 --- /dev/null +++ b/Replace-mock-import-with-compat.mock.patch @@ -0,0 +1,28 @@ +From ddf298097c26a855fa58137dba1931c28c4d22aa Mon Sep 17 00:00:00 2001 +From: Matt Clay +Date: Fri, 21 Apr 2023 13:00:21 -0700 +Subject: [PATCH] [stable-2.15] tests: replace a mock import with unittest.mock + (#80589) (#80603) + +(cherry picked from commit f4615d69ad2ef1f024ba677ee6a77f49a4b7bfff) + +Co-authored-by: Maxwell G +--- + test/units/ansible_test/test_validate_modules.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/units/ansible_test/test_validate_modules.py b/test/units/ansible_test/test_validate_modules.py +index ed2518d9c5369b..8397db7ddc7035 100644 +--- a/test/units/ansible_test/test_validate_modules.py ++++ b/test/units/ansible_test/test_validate_modules.py +@@ -1,9 +1,9 @@ + """Tests for validate-modules regexes.""" + from __future__ import annotations + +-import mock + import pathlib + import sys ++from unittest import mock + + import pytest + diff --git a/ansible-core.spec b/ansible-core.spec index 25f41a9..472f8e2 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -14,6 +14,7 @@ License: GPL-3.0-or-later AND BSD-2-Clause AND PSF-2.0 AND MIT AND Apache-2.0 Source0: https://github.com/ansible/ansible/archive/v%{uversion}/%{name}-%{uversion}.tar.gz Source1: build_manpages.py Patch: https://github.com/ansible/ansible/commit/79751ed970f01ff76270f3dbcae04aa87789eb05.patch#/improve-dnf-version-detection.patch +Patch: https://github.com/ansible/ansible/commit/ddf298097c26a855fa58137dba1931c28c4d22aa.patch#/Replace-mock-import-with-compat.mock.patch Url: https://ansible.com BuildArch: noarch