diff --git a/0001-Mock-the-.__class__-attribute-so-tests-pass-in-py2.patch b/0001-Mock-the-.__class__-attribute-so-tests-pass-in-py2.patch new file mode 100644 index 0000000..d13f635 --- /dev/null +++ b/0001-Mock-the-.__class__-attribute-so-tests-pass-in-py2.patch @@ -0,0 +1,25 @@ +From cdf486b9eb4f1c0f295ead9921631c16f3c39151 Mon Sep 17 00:00:00 2001 +From: Pierre-Yves Chibon +Date: Tue, 20 Aug 2019 14:15:19 +0200 +Subject: [PATCH] Mock the .__class__ attribute so tests pass in py2 + +Signed-off-by: Pierre-Yves Chibon +--- + test_version.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/test_version.py b/test_version.py +index f23ba4b..0d5a493 100644 +--- a/test_version.py ++++ b/test_version.py +@@ -1128,6 +1128,7 @@ class get_changelog_path_TestCase( + if not hasattr(self, 'script_filename'): + self.script_filename = self.default_script_filename + ++ self.test_distribution.__class__ = distutils.dist.Distribution + self.test_distribution.packages = None + self.test_distribution.package_dir = {'': self.script_directory} + self.test_distribution.script_name = self.script_filename +-- +2.21.0 + diff --git a/python-daemon.spec b/python-daemon.spec index 9acff6b..82ee5a4 100644 --- a/python-daemon.spec +++ b/python-daemon.spec @@ -10,7 +10,7 @@ Name: python-daemon Version: 2.2.3 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Library to implement a well-behaved Unix daemon process # Some build scripts and test franework are licensed GPLv3+ but htose aren't shipped @@ -19,6 +19,8 @@ URL: http://pypi.python.org/pypi/python-daemon/ Source0: https://files.pythonhosted.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz # Fix python3.8 socket tests. Already upstream. Patch0: https://pagure.io/python-daemon/c/b7089121e305ef29dee9b72bfdb8b1496ffed48c.patch +# Fix the test suite in py2 +Patch1: 0001-Mock-the-.__class__-attribute-so-tests-pass-in-py2.patch BuildArch: noarch BuildRequires: python2-devel, python2-setuptools @@ -115,6 +117,9 @@ PYTHONPATH=$(pwd) %{__python3} -m unittest discover %endif %changelog +* Tue Aug 20 2019 Pierre-Yves Chibon - 2.2.3-5 +- Patch the test suite so it passes with py2 + * Sun Aug 18 2019 Miro HronĨok - 2.2.3-4 - Rebuilt for Python 3.8