Hello community,
here is the log from the commit of package python-testtools for
openSUSE:Factory checked in at 2020-06-21 18:50:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-testtools (Old)
and /work/SRC/openSUSE:Factory/.python-testtools.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-testtools"
Sun Jun 21 18:50:26 2020 rev:27 rq:813502 version:2.4.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-testtools/python-testtools.changes
2020-03-27 00:26:01.704279021 +0100
+++
/work/SRC/openSUSE:Factory/.python-testtools.new.3606/python-testtools.changes
2020-06-21 19:06:39.121054827 +0200
@@ -1,0 +2,13 @@
+Thu Jun 11 08:21:52 UTC 2020 - [email protected]
+
+- move testsuite run to main package, remove -doc
+- added patches
+ unittest2 is not neccessary to run testsuite
+ + python-testtools-no-unittest2.patch
+
+-------------------------------------------------------------------
+Tue Jun 9 09:31:13 UTC 2020 - [email protected]
+
+- remove unittest2 runtime dependency
+
+-------------------------------------------------------------------
Old:
----
python-testtools-doc.changes
python-testtools-doc.spec
New:
----
python-testtools-no-unittest2.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-testtools.spec ++++++
--- /var/tmp/diff_new_pack.M22F2j/_old 2020-06-21 19:06:39.545056204 +0200
+++ /var/tmp/diff_new_pack.M22F2j/_new 2020-06-21 19:06:39.545056204 +0200
@@ -17,7 +17,15 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
-Name: python-testtools
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "test"
+%define psuffix -test
+%bcond_without test
+%else
+%define psuffix %{nil}
+%bcond_with test
+%endif
+Name: python-testtools%{psuffix}
Version: 2.4.0
Release: 0
Summary: Extensions to the Python Standard Library Unit Testing
Framework
@@ -25,7 +33,10 @@
Group: Development/Languages/Python
URL: https://github.com/testing-cabal/testtools
Source:
https://files.pythonhosted.org/packages/source/t/testtools/testtools-%{version}.tar.gz
-BuildRequires: %{python_module extras >= 1.0.0}
+# unittest2 is not neccessary to run testsuite
+# removing unittest2 entirely:
+# https://github.com/testing-cabal/testtools/pull/277
+Patch0: python-testtools-no-unittest2.patch
BuildRequires: %{python_module pbr}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
@@ -35,8 +46,14 @@
Requires: python-python-mimeparse
Requires: python-six >= 1.4.0
Requires: python-traceback2
-Requires: python-unittest2 >= 1.1.0
BuildArch: noarch
+%if %{with test}
+BuildRequires: %{python_module extras >= 1.0.0}
+BuildRequires: %{python_module python-mimeparse}
+BuildRequires: %{python_module six}
+BuildRequires: %{python_module testscenarios}
+BuildRequires: %{python_module traceback2}
+%endif
%if 0%{?suse_version} >= 1000 || 0%{?fedora_version} >= 24
Recommends: python-fixtures >= 1.3.0
%endif
@@ -50,18 +67,31 @@
%prep
%setup -q -n testtools-%{version}
+%patch0 -p1
+sed -i '/unittest2/d' requirements.txt setup.cfg
+%if !%{with test}
%build
%python_build
+%endif
+%if !%{with test}
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%endif
+
+%if %{with test}
+%check
+%python_exec -m testtools.run testtools.tests.test_suite
+%endif
+%if !%{with test}
%files %{python_files}
%license LICENSE
%doc NEWS README.rst
%{python_sitelib}/testtools
%{python_sitelib}/testtools-%{version}-py*.egg-info
+%endif
%changelog
++++++ python-testtools-no-unittest2.patch ++++++
Index: testtools-2.4.0/testtools/tests/twistedsupport/test_matchers.py
===================================================================
--- testtools-2.4.0.orig/testtools/tests/twistedsupport/test_matchers.py
2018-04-05 01:27:14.000000000 +0200
+++ testtools-2.4.0/testtools/tests/twistedsupport/test_matchers.py
2020-06-11 11:53:14.265535365 +0200
@@ -205,5 +205,10 @@ class FailureResultTests(NeedsTwistedTes
def test_suite():
- from unittest2 import TestLoader, TestSuite
+ from extras import try_imports
+ try:
+ import unittest2 as unittest
+ except ImportError:
+ import unittest
+ from unittest import TestLoader, TestSuite
return TestLoader().loadTestsFromName(__name__)
Index: testtools-2.4.0/testtools/tests/twistedsupport/test_deferred.py
===================================================================
--- testtools-2.4.0.orig/testtools/tests/twistedsupport/test_deferred.py
2018-04-05 01:27:14.000000000 +0200
+++ testtools-2.4.0/testtools/tests/twistedsupport/test_deferred.py
2020-06-11 11:55:46.398407913 +0200
@@ -52,5 +52,9 @@ class TestExtractResult(NeedsTwistedTest
def test_suite():
- from unittest2 import TestLoader, TestSuite
+ try:
+ import unittest2 as unittest
+ except ImportError:
+ import unittest
+ from unittest import TestLoader, TestSuite
return TestLoader().loadTestsFromName(__name__)
Index: testtools-2.4.0/testtools/tests/twistedsupport/test_runtest.py
===================================================================
--- testtools-2.4.0.orig/testtools/tests/twistedsupport/test_runtest.py
2018-04-05 01:27:14.000000000 +0200
+++ testtools-2.4.0/testtools/tests/twistedsupport/test_runtest.py
2020-06-11 11:56:56.142811412 +0200
@@ -1016,7 +1016,11 @@ class TestCaptureTwistedLogs(NeedsTwiste
def test_suite():
- from unittest2 import TestLoader, TestSuite
+ try:
+ import unittest2 as unittest
+ except ImportError:
+ import unittest
+ from unittest import TestLoader, TestSuite
return TestLoader().loadTestsFromName(__name__)
Index: testtools-2.4.0/testtools/tests/test_testsuite.py
===================================================================
--- testtools-2.4.0.orig/testtools/tests/test_testsuite.py 2018-04-05
01:27:14.000000000 +0200
+++ testtools-2.4.0/testtools/tests/test_testsuite.py 2020-06-11
11:41:10.153375835 +0200
@@ -5,7 +5,10 @@
import doctest
from pprint import pformat
import unittest
-import unittest2
+try:
+ import unittest2
+except ImportError:
+ unittest2 = None
from extras import try_import
@@ -16,6 +19,7 @@ from testtools import (
PlaceHolder,
TestByTestResult,
TestCase,
+ skipUnless
)
from testtools.compat import _u
from testtools.matchers import DocTestMatches, Equals
@@ -214,6 +218,7 @@ TypeError: run() takes ...1 ...argument.
tests = list(enumerate(iterate_tests(suite)))
return [(test, _u(str(pos))) for pos, test in tests]
+ @skipUnless(unittest2, "requries unittest2")
def test_setupclass_skip(self):
# We should support setupclass skipping using cls.skipException.
# Because folk have used that.
@@ -231,6 +236,7 @@ TypeError: run() takes ...1 ...argument.
suite.run(result)
self.assertEqual(['addSkip'], [item[0] for item in log])
+ @skipUnless(unittest2, "requries unittest2")
def test_setupclass_upcall(self):
# Note that this is kindof-a-case-test, kindof-suite, because
# setUpClass is linked between them.
Index: testtools-2.4.0/testtools/tests/test_run.py
===================================================================
--- testtools-2.4.0.orig/testtools/tests/test_run.py 2015-11-07
18:27:33.000000000 +0100
+++ testtools-2.4.0/testtools/tests/test_run.py 2020-06-11 11:34:41.815147077
+0200
@@ -10,7 +10,10 @@ from textwrap import dedent
from extras import try_import
fixtures = try_import('fixtures')
testresources = try_import('testresources')
-import unittest2
+try:
+ import unittest2
+except ImportError:
+ unittest2 = None
import testtools
from testtools import TestCase, run, skipUnless
@@ -191,6 +194,7 @@ class TestRun(TestCase):
testtools.runexample.TestFoo.test_quux
""", out.getvalue())
+ @skipUnless(unittest2, "requries unittest2")
def test_run_list_failed_import(self):
broken = self.useFixture(SampleTestFixture(broken=True))
out = StringIO()
@@ -337,6 +341,7 @@ OK
""")))
@skipUnless(fixtures, "fixtures not present")
+ @skipUnless(unittest2, "requries unittest2")
def test_issue_16662(self):
# unittest's discover implementation didn't handle load_tests on
# packages. That is fixed pending commit, but we want to offer it