From 68927c718b84d9f00f1ec1427fbfdf2252a62a07 Mon Sep 17 00:00:00 2001 From: starlet-dx <15929766099@163.com> Date: Thu, 6 Feb 2025 11:44:15 +0800 Subject: [PATCH] Adapt to pytest 8.x for fix test failure (cherry picked from commit b9a1b61cb9b8d8137d95d676f6684eacaf7302ab) --- ...t-to-pytest-8.x-for-fix-test-failure.patch | 50 +++++++++++++++++++ python-notario.spec | 7 ++- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 Adapt-to-pytest-8.x-for-fix-test-failure.patch diff --git a/Adapt-to-pytest-8.x-for-fix-test-failure.patch b/Adapt-to-pytest-8.x-for-fix-test-failure.patch new file mode 100644 index 0000000..4784522 --- /dev/null +++ b/Adapt-to-pytest-8.x-for-fix-test-failure.patch @@ -0,0 +1,50 @@ +From b8e9e67977ebd455ecf00ca141bcf6a41632d6d1 Mon Sep 17 00:00:00 2001 +From: starlet-dx <15929766099@163.com> +Date: Thu, 6 Feb 2025 11:38:42 +0800 +Subject: [PATCH 1/1] Adapt to pytest 8.x for fix test failure + +--- + notario/tests/test_regex.py | 2 +- + notario/tests/test_utils.py | 6 ++---- + 2 files changed, 3 insertions(+), 5 deletions(-) + +diff --git a/notario/tests/test_regex.py b/notario/tests/test_regex.py +index 075b867..6d18ac7 100644 +--- a/notario/tests/test_regex.py ++++ b/notario/tests/test_regex.py +@@ -27,7 +27,7 @@ class TestLinker(object): + + class TestLinkerSequentially(object): + +- def setup(self): ++ def __init__(self): + self.rxs = [(r"^\w+", "begin with a word"), + (r"-", "follow a dash"), + (r"_$", "end with an underscore")] +diff --git a/notario/tests/test_utils.py b/notario/tests/test_utils.py +index 53057f3..e94fe8c 100644 +--- a/notario/tests/test_utils.py ++++ b/notario/tests/test_utils.py +@@ -6,8 +6,7 @@ from notario.decorators import delay + + + class TestIsCallable(object): +- +- def setup(self): ++ def __init__(self): + def fake_callable(): pass + self.fake_callable = fake_callable + +@@ -102,8 +101,7 @@ class TestIsNestedTuple(object): + + + class TestDataItem(object): +- +- def setup(self): ++ def __init__(self): + self.ndict = utils.ndict() + + def test_return_key_from_ndict(self): +-- +2.48.1 + diff --git a/python-notario.spec b/python-notario.spec index 006434d..2e9695e 100644 --- a/python-notario.spec +++ b/python-notario.spec @@ -2,11 +2,13 @@ Name: python-notario Version: 0.0.16 -Release: 2 +Release: 3 Summary: A dictionary validator License: MIT URL: https://github.com/alfredodeza/notario Source0: https://files.pythonhosted.org/packages/88/43/7ba8c182d832f4cadb2ddeed8d1d3a21da7be4b88c1ddb8eaf0aadee37a2/%{srcname}-%{version}.tar.gz +# https://github.com/pytest-dev/pytest/issues/11667 +Patch0: Adapt-to-pytest-8.x-for-fix-test-failure.patch BuildArch: noarch BuildRequires: python3-devel @@ -45,6 +47,9 @@ py.test-%{python3_version} -v notario/tests %{python3_sitelib}/* %changelog +* Thu Feb 06 2025 yaoxin <1024769339@qq.com> - 0.0.16-3 +- Adapt to pytest 8.x for fix test failure + * Wed Jul 05 2023 yaoxin - 0.0.16-2 - Fix compilation errors caused by pytest update to 7.3.2 -- Gitee