From 00eb67aa94065a04d875f73d36b4133ad748fea2f64dfc20666b8351e1fac357 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 16 Oct 2021 19:31:23 +0000 Subject: [PATCH] - update to 2.5.0: * Update testtools/compat.py * Note Python 3.5 is EOL and will be dropped after the next release * Fix for Python 3.10 * Add python 3.10 to ci configuration * testtools.compat: provide BytesIO, StringIO again * Add support for Python 3.9 * Update and simplify workflow * Fix UserWarning: Usage of dash-separated ... * Fix tests with Python 3.10 * Remove mimeparse dependency * trivial: Cleanup imports * Re-introduce 'try\_imports' * Remove use of 'try\_imports' * tox: Don't skip sdist * Remove use of 'safe\_hasattr' * NEWS: Add note about unittest2 removal * Fix github actions * Update testtools/content.py * Update tox.ini * Update github actions config to use release 3.9 * Drop traceback2 in favor of traceback and remove unused linecache2 * Update tox.ini * Add tox.ini file * Remove tox.ini file * restore testtools/tests/test\_testcase.py * Remove unittest2 from setup.cfg and add tox.ini file * Remove unrelated change * Restore test\_spinner.py * Remove unused try\_import OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-testtools?expand=0&rev=70 --- python-testtools-no-unittest2.patch | 120 ---------------------------- python-testtools.changes | 48 +++++++++++ python-testtools.spec | 12 +-- testtools-2.4.0.tar.gz | 3 - testtools-2.5.0.tar.gz | 3 + 5 files changed, 54 insertions(+), 132 deletions(-) delete mode 100644 python-testtools-no-unittest2.patch delete mode 100644 testtools-2.4.0.tar.gz create mode 100644 testtools-2.5.0.tar.gz diff --git a/python-testtools-no-unittest2.patch b/python-testtools-no-unittest2.patch deleted file mode 100644 index 3b5b57e..0000000 --- a/python-testtools-no-unittest2.patch +++ /dev/null @@ -1,120 +0,0 @@ -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 diff --git a/python-testtools.changes b/python-testtools.changes index 3d0570a..2cf4364 100644 --- a/python-testtools.changes +++ b/python-testtools.changes @@ -1,3 +1,51 @@ +------------------------------------------------------------------- +Sat Oct 16 19:29:27 UTC 2021 - Dirk Müller + +- update to 2.5.0: + * Update testtools/compat.py + * Note Python 3.5 is EOL and will be dropped after the next release + * Fix for Python 3.10 + * Add python 3.10 to ci configuration + * testtools.compat: provide BytesIO, StringIO again + * Add support for Python 3.9 + * Update and simplify workflow + * Fix UserWarning: Usage of dash-separated ... + * Fix tests with Python 3.10 + * Remove mimeparse dependency + * trivial: Cleanup imports + * Re-introduce 'try\_imports' + * Remove use of 'try\_imports' + * tox: Don't skip sdist + * Remove use of 'safe\_hasattr' + * NEWS: Add note about unittest2 removal + * Fix github actions + * Update testtools/content.py + * Update tox.ini + * Update github actions config to use release 3.9 + * Drop traceback2 in favor of traceback and remove unused linecache2 + * Update tox.ini + * Add tox.ini file + * Remove tox.ini file + * restore testtools/tests/test\_testcase.py + * Remove unittest2 from setup.cfg and add tox.ini file + * Remove unrelated change + * Restore test\_spinner.py + * Remove unused try\_import + * Test on Python 3.9-dev + * Compare items using sets instead of sequences + * Add implementation for legacy assertItemsEqual existing in unittest2 library + * Do actually remove all references to unittest2 library + * Remove the travis config + * Add back travis config + * Update testtools/testcase.py + * Limit use of unittest2 to old Python versions + * Fix syntax error test for Python 3.9 + * Remove Travis CI config + * Test on GitHub Actions + * Remove stray six import + * Testtools 2.4.0 is the last to support Python 2.7 +- remove python-testtools-no-unittest2.patch (upstream) + ------------------------------------------------------------------- Thu Jun 11 08:21:52 UTC 2020 - pgajdos@suse.com diff --git a/python-testtools.spec b/python-testtools.spec index b377459..05d9804 100644 --- a/python-testtools.spec +++ b/python-testtools.spec @@ -1,7 +1,7 @@ # -# spec file for package python-testtools +# spec file # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,17 +26,13 @@ %bcond_with test %endif Name: python-testtools%{psuffix} -Version: 2.4.0 +Version: 2.5.0 Release: 0 Summary: Extensions to the Python Standard Library Unit Testing Framework License: MIT Group: Development/Languages/Python URL: https://github.com/testing-cabal/testtools Source: https://files.pythonhosted.org/packages/source/t/testtools/testtools-%{version}.tar.gz -# 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 @@ -67,8 +63,6 @@ also ports recent unittest changes all the way back to Python 2.4. %prep %setup -q -n testtools-%{version} -%patch0 -p1 -sed -i '/unittest2/d' requirements.txt setup.cfg %if !%{with test} %build diff --git a/testtools-2.4.0.tar.gz b/testtools-2.4.0.tar.gz deleted file mode 100644 index e1bcfcb..0000000 --- a/testtools-2.4.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:64c974a6cca4385d05f4bbfa2deca1c39ce88ede31c3448bee86a7259a9a61c8 -size 233032 diff --git a/testtools-2.5.0.tar.gz b/testtools-2.5.0.tar.gz new file mode 100644 index 0000000..bc18770 --- /dev/null +++ b/testtools-2.5.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57c13433d94f9ffde3be6534177d10fb0c1507cc499319128958ca91a65cb23f +size 235399