Compare commits
1 Commits
Author | SHA256 | Date | |
---|---|---|---|
e7c12f86eb |
@@ -1,15 +1,3 @@
|
|||||||
-------------------------------------------------------------------
|
|
||||||
Wed May 8 06:37:08 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
|
||||||
|
|
||||||
- Do not use pytest for the testsuite, switch to %pyunittest.
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Wed Aug 16 02:47:15 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
|
|
||||||
|
|
||||||
- Add patch use-correct-assertions.patch:
|
|
||||||
* Use current and correct method names.
|
|
||||||
- Switch to pyproject macros.
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Apr 21 12:37:18 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
Fri Apr 21 12:37:18 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-testresources
|
# spec file for package python-testresources
|
||||||
#
|
#
|
||||||
# Copyright (c) 2024 SUSE LLC
|
# Copyright (c) 2023 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -25,14 +25,11 @@ License: (Apache-2.0 OR BSD-3-Clause) AND GPL-2.0-or-later
|
|||||||
URL: https://github.com/testing-cabal/testresources
|
URL: https://github.com/testing-cabal/testresources
|
||||||
Source: https://files.pythonhosted.org/packages/source/t/testresources/testresources-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/t/testresources/testresources-%{version}.tar.gz
|
||||||
Patch0: testresources-flaky-tests.patch
|
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 fixtures}
|
||||||
BuildRequires: %{python_module pbr}
|
BuildRequires: %{python_module pbr}
|
||||||
BuildRequires: %{python_module pip}
|
BuildRequires: %{python_module pytest}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: %{python_module testtools}
|
BuildRequires: %{python_module testtools}
|
||||||
BuildRequires: %{python_module wheel}
|
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-pbr
|
Requires: python-pbr
|
||||||
@@ -44,22 +41,23 @@ testresources: extensions to python unittest to allow declarative use
|
|||||||
of resources by test cases.
|
of resources by test cases.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1 -n testresources-%{version}
|
%setup -q -n testresources-%{version}
|
||||||
|
%patch0 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%pyproject_wheel
|
%python_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%pyproject_install
|
%python_install
|
||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%pyunittest
|
%pytest
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%license BSD Apache-2.0 COPYING
|
%license BSD Apache-2.0 COPYING
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
%{python_sitelib}/testresources
|
%{python_sitelib}/testresources
|
||||||
%{python_sitelib}/testresources-%{version}.dist-info
|
%{python_sitelib}/testresources-%{version}-py%{python_version}.egg-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
@@ -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)
|
|
Reference in New Issue
Block a user