From 6ebcbde2596a373b5ebb3ac9e4f80ccc6174506c00fc6e8461646946cf8e2402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 13 Dec 2024 12:30:27 +0100 Subject: [PATCH] Sync from SUSE:SLFO:Main python-testtools revision 9ec4a8ee62291255c6e514a4edca1514 --- _multibuild | 3 +++ python-testtools.changes | 52 +++++++++++++++++++++++++++++++++----- python-testtools.rpmlintrc | 1 - python-testtools.spec | 35 +++++++++++++------------ testtools-2.6.0.tar.gz | 3 --- testtools-2.7.2.tar.gz | 3 +++ twisted.patch | 46 +++++++++++++++++++++++++++++++++ 7 files changed, 116 insertions(+), 27 deletions(-) create mode 100644 _multibuild delete mode 100644 python-testtools.rpmlintrc delete mode 100644 testtools-2.6.0.tar.gz create mode 100644 testtools-2.7.2.tar.gz create mode 100644 twisted.patch diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/python-testtools.changes b/python-testtools.changes index cd42d1d..4e39342 100644 --- a/python-testtools.changes +++ b/python-testtools.changes @@ -1,3 +1,41 @@ +------------------------------------------------------------------- +Mon Sep 23 14:06:48 UTC 2024 - Markéta Machová + +- Update to 2.7.2 + * Treat methodName="runTest" similar to unittest.TestCase, + fixes compatibility with pytest 8.3. (Natanael Copa, #372) + * Use ruff for linting. (Jelmer Vernooij) + * Fix compatibility with Python 3.12.1. (Matthew Treinish) + * Deprecate SkippedTest exception. (Stephen Finucane) + * Drop support for Python 3.7. (Jelmer Vernooij) +- Drop merged pytest82.patch +- Add upstream twisted.patch to fix tests with new Twisted + +------------------------------------------------------------------- +Fri May 17 14:07:33 UTC 2024 - Markéta Machová + +- Add pytest82.patch to fix functionality with the new pytest. + +------------------------------------------------------------------- +Wed May 8 06:42:24 UTC 2024 - Steve Kowalik + +- Drop the now unneeded rpmlintrc. +- Clean up BuildRequires and Requires to match reality. +- Add missing _multibuild file. + +------------------------------------------------------------------- +Sat Dec 30 20:31:27 UTC 2023 - Dirk Müller + +- update to 2.7.1: + * Remove various unused imports. + * Fix build backend. This should prevent version from being set + when building wheels. + * Fix compatibility with Python 3.12. + * Add typing in various modules (still lacking full coverage). + * Drop the 'test' command for distutils. This has been + deprecated since 2.6.0. (Jelmer Vernooij) + * Drop support for Python 3.6. + ------------------------------------------------------------------- Thu May 4 21:18:15 UTC 2023 - Dirk Müller @@ -82,7 +120,7 @@ Sat Oct 16 19:29:27 UTC 2021 - Dirk Müller * 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) +- remove python-testtools-no-unittest2.patch (upstream) ------------------------------------------------------------------- Thu Jun 11 08:21:52 UTC 2020 - pgajdos@suse.com @@ -186,7 +224,7 @@ Sun Apr 2 09:48:51 UTC 2017 - aloisio@gmx.com ------------------------------------------------------------------- Mon Feb 27 07:31:26 UTC 2017 - shshyukriev@suse.com -- BuildRequires also using extras>=1.0.0 +- BuildRequires also using extras>=1.0.0 ------------------------------------------------------------------- Thu Sep 1 12:43:29 UTC 2016 - tbechtold@suse.com @@ -407,7 +445,7 @@ Tue Aug 30 11:41:55 UTC 2016 - tbechtold@suse.com ------------------------------------------------------------------- Mon Dec 1 22:48:47 UTC 2014 - dmueller@suse.com -- fix typo in last change +- fix typo in last change ------------------------------------------------------------------- Mon Dec 1 17:04:18 UTC 2014 - rhafer@suse.com @@ -532,7 +570,7 @@ Thu Aug 8 13:47:56 UTC 2013 - speilicke@suse.com Thu Aug 8 13:22:20 UTC 2013 - speilicke@suse.com - Totally disable testing to bootstrap ppc64. Actually the build conditional is - supposed to do just that. + supposed to do just that. ------------------------------------------------------------------- Tue Jun 25 11:35:04 UTC 2013 - speilicke@suse.com @@ -559,7 +597,7 @@ Fri Jun 21 08:21:16 UTC 2013 - speilicke@suse.com ------------------------------------------------------------------- Mon May 6 11:25:43 UTC 2013 - dmueller@suse.com -- add python-mmimeparse dependency +- add python-mmimeparse dependency ------------------------------------------------------------------- Tue Apr 23 09:33:35 UTC 2013 - p.drouand@gmail.com @@ -595,13 +633,13 @@ Tue Jan 15 16:43:28 UTC 2013 - p.drouand@gmail.com Mon Jan 14 12:38:00 UTC 2013 - saschpe@suse.de - Update to version 0.9.24: - * testtools.run discover will now sort the tests it discovered. This is a + * testtools.run discover will now sort the tests it discovered. This is a workaround for http://bugs.python.org/issue16709. Non-standard test suites are preserved, and their sort_tests() method called (if they have such an attribute). testtools.testsuite.sorted_tests(suite, True) can be used by such suites to do a local sort. * ThreadsafeForwardingResult now defines a stub progress method, which - fixes testr run of streams containing progress markers (by discarding the + fixes testr run of streams containing progress markers (by discarding the progress data). - Changes from version 0.9.23: * run.TestToolsTestRunner now accepts the verbosity, buffer and failfast diff --git a/python-testtools.rpmlintrc b/python-testtools.rpmlintrc deleted file mode 100644 index 9544ff5..0000000 --- a/python-testtools.rpmlintrc +++ /dev/null @@ -1 +0,0 @@ -addFilter("E: python-tests-in-package.*/usr/lib/.*/site-packages/testtools/tests") diff --git a/python-testtools.spec b/python-testtools.spec index 30af6ec..639b436 100644 --- a/python-testtools.spec +++ b/python-testtools.spec @@ -1,7 +1,7 @@ # -# spec file +# spec file for package python-testtools # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,26 +26,29 @@ %endif %{?sle15_python_module_pythons} Name: python-testtools%{psuffix} -Version: 2.6.0 +Version: 2.7.2 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 Source0: https://files.pythonhosted.org/packages/source/t/testtools/testtools-%{version}.tar.gz -Source99: python-testtools.rpmlintrc -BuildRequires: %{python_module pbr} -BuildRequires: %{python_module setuptools} +# PATCH-FIX-UPSTREAM https://github.com/testing-cabal/testtools/commit/5b8cb6497c7159f593e68de6a13e15f7e78e56e3 Prepare tests for upcoming twisted version +Patch0: twisted.patch +BuildRequires: %{python_module hatch_vcs} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-pbr >= 0.11 -Requires: python-python-mimeparse -Requires: python-traceback2 +Requires: python-Twisted +%if %python_version_nodots > 311 +Requires: python-setuptools +%endif BuildArch: noarch %if %{with test} -BuildRequires: %{python_module python-mimeparse} +BuildRequires: %{python_module fixtures} +BuildRequires: %{python_module testresources} BuildRequires: %{python_module testscenarios} -BuildRequires: %{python_module traceback2} +BuildRequires: %{python_module testtools = %{version}} %endif Recommends: python-fixtures >= 2.0 %python_subpackages @@ -57,16 +60,16 @@ with unit tests in Python and come from many different sources. testtools also ports recent unittest changes all the way back to Python 2.4. %prep -%setup -q -n testtools-%{version} +%autosetup -p1 -n testtools-%{version} %if !%{with test} %build -%python_build +%pyproject_wheel %endif %if !%{with test} %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %endif @@ -80,7 +83,7 @@ also ports recent unittest changes all the way back to Python 2.4. %license LICENSE %doc NEWS README.rst %{python_sitelib}/testtools -%{python_sitelib}/testtools-%{version}-py*.egg-info +%{python_sitelib}/testtools-%{version}.dist-info %endif %changelog diff --git a/testtools-2.6.0.tar.gz b/testtools-2.6.0.tar.gz deleted file mode 100644 index 6a65148..0000000 --- a/testtools-2.6.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:28b65e14c0f2d3ecbbfb5f55c9dcde5e4faa80ac16a37a823909a1fe3cbcb30a -size 237864 diff --git a/testtools-2.7.2.tar.gz b/testtools-2.7.2.tar.gz new file mode 100644 index 0000000..9863c05 --- /dev/null +++ b/testtools-2.7.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5be5bbc1f0fa0f8b60aca6ceec07845d41d0c475cf445bfadb4d2c45ec397ea3 +size 201430 diff --git a/twisted.patch b/twisted.patch new file mode 100644 index 0000000..cb1482d --- /dev/null +++ b/twisted.patch @@ -0,0 +1,46 @@ +From 5b8cb6497c7159f593e68de6a13e15f7e78e56e3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20Van=C4=9Bk?= +Date: Mon, 1 Jul 2024 10:00:05 +0200 +Subject: [PATCH] Prepare tests for upcoming twisted version + +Twisted recently changed behavior of logger on failures [1]. It newly +logs the `Main loop terminated.` even on exceptions, which breaks two +test in twistedsupport test suite. This hack attempts to address the +upcoming issue. + +[1] https://github.com/twisted/twisted/pull/12207 +--- + testtools/tests/twistedsupport/test_runtest.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/testtools/tests/twistedsupport/test_runtest.py b/testtools/tests/twistedsupport/test_runtest.py +index 4b46cc64..f8faf7c6 100644 +--- a/testtools/tests/twistedsupport/test_runtest.py ++++ b/testtools/tests/twistedsupport/test_runtest.py +@@ -16,7 +16,6 @@ + Contains, + ContainsAll, + ContainsDict, +- EndsWith, + Equals, + Is, + KeysEqual, +@@ -749,7 +748,7 @@ def test_something(self): + test, + { + "traceback": Not(Is(None)), +- "twisted-log": AsText(EndsWith(" foo\n")), ++ "twisted-log": AsText(Contains(" foo\n")), + }, + ), + ("stopTest", test), +@@ -790,7 +789,8 @@ def test_something(self): + result = self.make_result() + runner.run(result) + self.assertThat( +- messages, MatchesListwise([ContainsDict({"message": Equals(("foo",))})]) ++ messages[0:1], ++ MatchesListwise([ContainsDict({"message": Equals(("foo",))})]), + ) + + def test_restore_observers(self):