14
0

- 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
This commit is contained in:
2021-10-16 19:31:23 +00:00
committed by Git OBS Bridge
parent d5cce6b72d
commit 00eb67aa94
5 changed files with 54 additions and 132 deletions

View File

@@ -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

View File

@@ -1,3 +1,51 @@
-------------------------------------------------------------------
Sat Oct 16 19:29:27 UTC 2021 - Dirk Müller <dmueller@suse.com>
- 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

View File

@@ -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

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:64c974a6cca4385d05f4bbfa2deca1c39ce88ede31c3448bee86a7259a9a61c8
size 233032

3
testtools-2.5.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:57c13433d94f9ffde3be6534177d10fb0c1507cc499319128958ca91a65cb23f
size 235399