Sync from SUSE:SLFO:Main python-testresources revision 80c43ae987456ec8dae12b9a3df09065

This commit is contained in:
2025-06-27 15:57:26 +02:00
parent 7c1e7c61ab
commit ca23cebaf3
6 changed files with 21 additions and 53 deletions

View File

@@ -1,3 +1,15 @@
-------------------------------------------------------------------
Fri May 16 06:21:57 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Update to 2.0.2
* Skip testBasicSortTests in general (Kelledin)
* Add a TestResourceManager.id() API for letting test results
report about a resource identity (freeekanayaka)
* Refactor failIf to assertFalse for Python 3.12 Compatibility (cjwatson)
* Add support for Python >=3.10 (jelmer)
- Drop use-correct-assertions.patch, merged upstream
- Refresh testresources-flaky-tests.patch
-------------------------------------------------------------------
Wed May 8 06:37:08 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>

View File

@@ -18,15 +18,13 @@
%{?sle15_python_module_pythons}
Name: python-testresources
Version: 2.0.1
Version: 2.0.2
Release: 0
Summary: A pyunit extension for managing expensive test resources
License: (Apache-2.0 OR BSD-3-Clause) AND GPL-2.0-or-later
URL: https://github.com/testing-cabal/testresources
Source: https://files.pythonhosted.org/packages/source/t/testresources/testresources-%{version}.tar.gz
Patch0: testresources-flaky-tests.patch
# PATCH-FIX-UPSTREAM gh#testing-cabal/testresources#15
Patch1: use-correct-assertions.patch
BuildRequires: %{python_module fixtures}
BuildRequires: %{python_module pbr}
BuildRequires: %{python_module pip}

BIN
testresources-2.0.1.tar.gz (Stored with Git LFS)

Binary file not shown.

BIN
testresources-2.0.2.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -1,12 +1,11 @@
Index: testresources-2.0.1/testresources/tests/test_optimising_test_suite.py
===================================================================
--- testresources-2.0.1.orig/testresources/tests/test_optimising_test_suite.py
+++ testresources-2.0.1/testresources/tests/test_optimising_test_suite.py
@@ -498,6 +498,7 @@ class TestGraphStuff(testtools.TestCase)
diff -Nru testresources-2.0.2.orig/testresources/tests/test_optimising_test_suite.py testresources-2.0.2/testresources/tests/test_optimising_test_suite.py
--- testresources-2.0.2.orig/testresources/tests/test_optimising_test_suite.py 2025-04-22 12:21:27.000000000 +0200
+++ testresources-2.0.2/testresources/tests/test_optimising_test_suite.py 2025-05-16 08:21:08.834763803 +0200
@@ -537,6 +537,7 @@
permutations.append([case4, case1, case3, case2])
return permutations
+ @unittest.skip("too flaky")
def testBasicSortTests(self):
self.skipTest("flaky, see LP #1645008")
# Test every permutation of inputs, with legacy tests.
# Cannot use equal costs because of the use of

View File

@@ -1,41 +0,0 @@
From 7bb62a13fa1d28717c10f3152b5e8ea479c8e9d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Van=C4=9Bk?= <arkamar@atlas.cz>
Date: Wed, 31 May 2023 08:40:30 +0200
Subject: [PATCH] Refactor failIf to assertFalse for Python 3.12 Compatibility
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This commit replaces deprecated failIf calls with assertFalse in the
test_resourced_test_case.py file. The failIf method was removed in
Python 3.12 [1-3].
[1] https://docs.python.org/3.12/whatsnew/3.12.html#removed
[2] https://github.com/python/cpython/issues/89325
[3] https://github.com/python/cpython/pull/28268
Signed-off-by: Petr Vaněk <arkamar@atlas.cz>
---
testresources/tests/test_resourced_test_case.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testresources/tests/test_resourced_test_case.py b/testresources/tests/test_resourced_test_case.py
index 7d2cfba..3c8a1b3 100644
--- a/testresources/tests/test_resourced_test_case.py
+++ b/testresources/tests/test_resourced_test_case.py
@@ -129,7 +129,7 @@ def testTearDownResourcesDeletesResourceAttributes(self):
self.resourced_case.resources = [("foo", self.resource_manager)]
self.resourced_case.setUpResources()
self.resourced_case.tearDownResources()
- self.failIf(hasattr(self.resourced_case, "foo"))
+ self.assertFalse(hasattr(self.resourced_case, "foo"))
def testTearDownResourcesStopsUsingResource(self):
# tearDownResources records that there is one less use of each
@@ -158,5 +158,5 @@ def testSingleWithSetup(self):
self.assertEqual(self.resourced_case.foo, self.resource)
self.assertEqual(self.resource_manager._uses, 1)
self.resourced_case.tearDown()
- self.failIf(hasattr(self.resourced_case, "foo"))
+ self.assertFalse(hasattr(self.resourced_case, "foo"))
self.assertEqual(self.resource_manager._uses, 0)