From 41d2454b6e1f2c12c2500b8c81e33aaafa4aa1ff Mon Sep 17 00:00:00 2001 From: Alfredo Moralejo Date: Jun 01 2020 11:09:17 +0000 Subject: Drop use of unittest2 This replaces unittest2 in favor of the standard unittest package. It's cherry-pick from upstream --- diff --git a/0001-Drop-use-of-unittest2.patch b/0001-Drop-use-of-unittest2.patch new file mode 100644 index 0000000..004bd78 --- /dev/null +++ b/0001-Drop-use-of-unittest2.patch @@ -0,0 +1,60 @@ +From 80a6e26650302329fa9aff26efa389bd99e397c5 Mon Sep 17 00:00:00 2001 +From: Sean McGinnis +Date: Sun, 12 Jan 2020 02:36:28 -0600 +Subject: [PATCH] Drop use of unittest2 + +unittest2 was needed for Python version <= 2.6, so it has not been +needed for quite some time now. See unittest2 note on: + +https://docs.python.org/2.7/library/unittest.html + +This replaces unittest2 in favor of the standard unittest package. + +Change-Id: Idd5df4c8068810bbbd2bd5058ca38df9f5416a62 +Signed-off-by: Sean McGinnis +--- + lower-constraints.txt | 1 - + oslo_log/tests/unit/test_versionutils.py | 5 +++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/lower-constraints.txt b/lower-constraints.txt +index 3644ce5..c7ca21f 100644 +--- a/lower-constraints.txt ++++ b/lower-constraints.txt +@@ -65,6 +65,5 @@ systemd-python==234 + testrepository==0.0.20 + testtools==2.3.0 + traceback2==1.4.0 +-unittest2==1.1.0 + urllib3==1.22 + wrapt==1.10.11 +diff --git a/oslo_log/tests/unit/test_versionutils.py b/oslo_log/tests/unit/test_versionutils.py +index 3084914..23ee8d4 100644 +--- a/oslo_log/tests/unit/test_versionutils.py ++++ b/oslo_log/tests/unit/test_versionutils.py +@@ -13,11 +13,12 @@ + # License for the specific language governing permissions and limitations + # under the License. + ++import unittest ++ + import mock + from oslotest import base as test_base + import six + from testtools import matchers +-import unittest2 + + from oslo_log import versionutils + +@@ -247,7 +248,7 @@ class DeprecatedTestCase(test_base.BaseTestCase): + as_of='Juno', + remove_in='Kilo') + +- @unittest2.skipIf( ++ @unittest.skipIf( + six.PY3, + 'Deprecated exception detection does not work for Python 3') + @mock.patch('oslo_log.versionutils.report_deprecated_feature') +-- +2.20.1 + diff --git a/python-oslo-log.spec b/python-oslo-log.spec index f3debdf..b083e5e 100644 --- a/python-oslo-log.spec +++ b/python-oslo-log.spec @@ -32,6 +32,7 @@ Summary: OpenStack Oslo Log library License: ASL 2.0 URL: http://launchpad.net/oslo Source0: https://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{upstream_version}.tar.gz +Patch0001: 0001-Drop-use-of-unittest2.patch BuildArch: noarch %package -n python%{pyver}-%{pkg_name}