diff --git a/python-rollbar-no-unittest2.patch b/python-rollbar-no-unittest2.patch new file mode 100644 index 0000000..22e9033 --- /dev/null +++ b/python-rollbar-no-unittest2.patch @@ -0,0 +1,19 @@ +Index: pyrollbar-0.15.0/rollbar/test/__init__.py +=================================================================== +--- pyrollbar-0.15.0.orig/rollbar/test/__init__.py 2020-04-04 02:08:37.000000000 +0200 ++++ pyrollbar-0.15.0/rollbar/test/__init__.py 2020-06-03 10:51:15.137644743 +0200 +@@ -1,9 +1,12 @@ +-import unittest2 ++try: ++ import unittest2 as unittest ++except ImportError: ++ import unittest + + + SNOWMAN = b'\xe2\x98\x83' + SNOWMAN_UNICODE = SNOWMAN.decode('utf8') + + +-class BaseTest(unittest2.TestCase): ++class BaseTest(unittest.TestCase): + pass diff --git a/python-rollbar.changes b/python-rollbar.changes index 2e0a987..1ac60b2 100644 --- a/python-rollbar.changes +++ b/python-rollbar.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Jun 3 09:05:04 UTC 2020 - pgajdos@suse.com + +- use %pytest macro +- remove dependency on unittest2 for python3 +- added patches + https://github.com/rollbar/pyrollbar/pull/340 + + python-rollbar-no-unittest2.patch + ------------------------------------------------------------------- Tue May 19 09:27:47 UTC 2020 - Petr Gajdos diff --git a/python-rollbar.spec b/python-rollbar.spec index c238634..61496bf 100644 --- a/python-rollbar.spec +++ b/python-rollbar.spec @@ -26,12 +26,14 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/rollbar/pyrollbar Source: https://github.com/rollbar/pyrollbar/archive/v%{version}.tar.gz +# https://github.com/rollbar/pyrollbar/pull/340 +Patch0: python-rollbar-no-unittest2.patch BuildRequires: %{python_module WebOb} BuildRequires: %{python_module blinker} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module requests >= 0.12.1} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six >= 1.9.0} -BuildRequires: %{python_module unittest2} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-requests >= 0.12.1 @@ -43,6 +45,7 @@ BuildArch: noarch %if %{with python2} BuildRequires: python2-enum34 BuildRequires: python2-mock +BuildRequires: python2-unittest2 %endif %python_subpackages @@ -51,6 +54,7 @@ Send messages and exceptions with arbitrary context, get back aggregates, and de %prep %setup -q -n pyrollbar-%{version} +%patch0 -p1 %build %python_build @@ -61,7 +65,7 @@ Send messages and exceptions with arbitrary context, get back aggregates, and de %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%python_exec setup.py test +%pytest %post %python_install_alternative rollbar