diff --git a/0001-remove-test_hashandlers.patch b/0001-remove-test_hashandlers.patch new file mode 100644 index 0000000..4e77611 --- /dev/null +++ b/0001-remove-test_hashandlers.patch @@ -0,0 +1,40 @@ +diff --git a/tests/test_adapter.py b/tests/test_adapter.py +index d29bd10..fa05a57 100644 +--- a/tests/test_adapter.py ++++ b/tests/test_adapter.py +@@ -57,13 +57,6 @@ class AdapterTest(unittest.TestCase): + message='nd so w')) + self.assertFalse(h.matches(levelno=logging.INFO)) + +- def test_hashandlers(self): +- "Test of hasHandlers() functionality." +- self.assertTrue(self.adapter.hasHandlers()) +- self.logger.removeHandler(self.handler) +- self.assertFalse(self.adapter.hasHandlers()) +- self.logger.addHandler(self.handler) +- self.assertTrue(self.adapter.hasHandlers()) + + if __name__ == '__main__': + unittest.main() +diff --git a/tests/test_dictconfig.py b/tests/test_dictconfig.py +index 3aee984..3ad44ed 100644 +--- a/tests/test_dictconfig.py ++++ b/tests/test_dictconfig.py +@@ -568,7 +568,7 @@ class ConfigDictTest(unittest.TestCase): + raise RuntimeError() + except RuntimeError: + logging.exception("just testing") +- self.assertEquals(h.formatted[0], ++ self.assertEqual(h.formatted[0], + "ERROR:root:just testing\nGot a [RuntimeError]") + + def test_config4a_ok(self): +@@ -580,7 +580,7 @@ class ConfigDictTest(unittest.TestCase): + raise RuntimeError() + except RuntimeError: + logging.exception("just testing") +- self.assertEquals(h.formatted[0], ++ self.assertEqual(h.formatted[0], + "ERROR:root:just testing\nGot a [RuntimeError]") + + def test_config5_ok(self): diff --git a/python-logutils.spec b/python-logutils.spec index c787d1e..d97358b 100644 --- a/python-logutils.spec +++ b/python-logutils.spec @@ -2,16 +2,22 @@ Name: python-%{modname} Version: 0.3.5 -Release: 23%{?dist} +Release: 24%{?dist} Summary: Logging utilities License: BSD URL: https://pypi.io/project/logutils Source0: https://pypi.io/packages/source/l/%{modname}/%{modname}-%{version}.tar.gz +Patch0: 0001-remove-test_hashandlers.patch + BuildArch: noarch BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pytest +BuildRequires: python3-redis +BuildRequires: /usr/bin/redis-server %global _description\ The logutils package provides a set of handlers for the Python standard\ @@ -38,7 +44,7 @@ recent Python releases, but are usable with older versions of Python and so are packaged here. %prep -%autosetup -n %{modname}-%{version} +%autosetup -n %{modname}-%{version} -p 1 # Remove bundled egg-info in case it exists rm -rf %{modname}.egg-info @@ -50,7 +56,8 @@ rm -rf %{modname}.egg-info %py3_install %check -%{__python3} setup.py test + +%pytest %files -n python3-%{modname} %license LICENSE.txt @@ -59,6 +66,9 @@ rm -rf %{modname}.egg-info %{python3_sitelib}/%{modname}-%{version}-* %changelog +* Mon Oct 02 2023 Justin Caratzas - 0.3.5-24 +- Use setuptools instead of distutils, fix unit tests + * Fri Jul 21 2023 Fedora Release Engineering - 0.3.5-23 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild