Skip to content

Commit

Permalink
[fc] Repository: Products.CMFPlone
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2024-11-27T15:04:49-03:00
Author: Peter Mathis (petschki) <[email protected]>
Commit: plone/Products.CMFPlone@598e64e

unittest.makeSuite got removed in py3.13

Files changed:
M Products/CMFPlone/exportimport/tests/testControlPanel.py
M Products/CMFPlone/tests/testNavigationView.py
M Products/CMFPlone/tests/testWebDAV.py
Repository: Products.CMFPlone

Branch: refs/heads/master
Date: 2024-11-28T11:39:00-03:00
Author: Peter Mathis (petschki) <[email protected]>
Commit: plone/Products.CMFPlone@6de7d4c

changenote

Files changed:
A news/4066.bugfix
Repository: Products.CMFPlone

Branch: refs/heads/master
Date: 2024-11-28T23:05:40-03:00
Author: Peter Mathis (petschki) <[email protected]>
Commit: plone/Products.CMFPlone@624c71d

Merge pull request #4066 from plone/py-3.13-unittest-fix

Python 3.13.x: `unittest.makeSuite` got removed.

Files changed:
A news/4066.bugfix
M Products/CMFPlone/exportimport/tests/testControlPanel.py
M Products/CMFPlone/tests/testNavigationView.py
M Products/CMFPlone/tests/testWebDAV.py
  • Loading branch information
petschki committed Nov 29, 2024
1 parent 4807637 commit d6a8380
Showing 1 changed file with 24 additions and 41 deletions.
65 changes: 24 additions & 41 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,69 +1,52 @@
Repository: plone.protect
Repository: Products.CMFPlone


Branch: refs/heads/master
Date: 2024-11-27T15:49:08-03:00
Date: 2024-11-27T15:04:49-03:00
Author: Peter Mathis (petschki) <[email protected]>
Commit: https://github.com/plone/plone.protect/commit/8f8cb1606e3355b720c4fd45c95ef5ca3b370be4
Commit: https://github.com/plone/Products.CMFPlone/commit/598e64e95713eb54f36fd854f9293ab5ac1bc1bb

Fix removed `unittest.makeSuite`in python 3.13
unittest.makeSuite got removed in py3.13

Files changed:
M plone/protect/tests/testAuthenticator.py
M plone/protect/tests/testPostOnly.py
M plone/protect/tests/testUtils.py
M Products/CMFPlone/exportimport/tests/testControlPanel.py
M Products/CMFPlone/tests/testNavigationView.py
M Products/CMFPlone/tests/testWebDAV.py

b'diff --git a/plone/protect/tests/testAuthenticator.py b/plone/protect/tests/testAuthenticator.py\nindex ffbb884..7c7e863 100644\n--- a/plone/protect/tests/testAuthenticator.py\n+++ b/plone/protect/tests/testAuthenticator.py\n@@ -7,7 +7,7 @@\n from plone.protect.authenticator import check\n from plone.protect.tests.case import KeyringTestCase\n from plone.protect.tests.case import MockRequest\n-from unittest import makeSuite\n+from unittest import defaultTestLoader\n from unittest import TestSuite\n from zExceptions import Forbidden\n from ZPublisher.HTTPRequest import HTTPRequest\n@@ -144,8 +144,8 @@ def func(REQUEST=self.request):\n \n \n def test_suite():\n- suite = TestSuite()\n- suite.addTest(makeSuite(AuthenticatorTests))\n- suite.addTest(makeSuite(VerifyTests))\n- suite.addTest(makeSuite(DecoratorTests))\n- return suite\n+ return TestSuite((\n+ defaultTestLoader.loadTestsFromTestCase(AuthenticatorTests),\n+ defaultTestLoader.loadTestsFromTestCase(VerifyTests),\n+ defaultTestLoader.loadTestsFromTestCase(DecoratorTests),\n+ ))\ndiff --git a/plone/protect/tests/testPostOnly.py b/plone/protect/tests/testPostOnly.py\nindex 7654fb1..0d00356 100644\n--- a/plone/protect/tests/testPostOnly.py\n+++ b/plone/protect/tests/testPostOnly.py\n@@ -1,5 +1,5 @@\n from plone.protect.postonly import check\n-from unittest import makeSuite\n+from unittest import defaultTestLoader\n from unittest import TestCase\n from unittest import TestSuite\n from zExceptions import Forbidden\n@@ -25,6 +25,6 @@ def testPOSTRequestAllowed(self):\n \n \n def test_suite():\n- suite = TestSuite()\n- suite.addTest(makeSuite(PostOnlyTests))\n- return suite\n+ return TestSuite((\n+ defaultTestLoader.loadTestsFromTestCase(PostOnlyTests),\n+ ))\ndiff --git a/plone/protect/tests/testUtils.py b/plone/protect/tests/testUtils.py\nindex 5a3bf86..b4844a5 100644\n--- a/plone/protect/tests/testUtils.py\n+++ b/plone/protect/tests/testUtils.py\n@@ -1,7 +1,7 @@\n from plone.protect.testing import PROTECT_FUNCTIONAL_TESTING\n from plone.protect.utils import addTokenToUrl\n from plone.protect.utils import protect\n-from unittest import makeSuite\n+from unittest import defaultTestLoader\n from unittest import TestCase\n from unittest import TestSuite\n \n@@ -71,7 +71,7 @@ def testWithNone(self):\n \n \n def test_suite():\n- suite = TestSuite()\n- suite.addTest(makeSuite(DecoratorTests))\n- suite.addTest(makeSuite(UrlTests))\n- return suite\n+ return TestSuite((\n+ defaultTestLoader.loadTestsFromTestCase(DecoratorTests),\n+ defaultTestLoader.loadTestsFromTestCase(UrlTests),\n+ ))\n'
b'diff --git a/Products/CMFPlone/exportimport/tests/testControlPanel.py b/Products/CMFPlone/exportimport/tests/testControlPanel.py\nindex a3582be816..d78b65ac41 100644\n--- a/Products/CMFPlone/exportimport/tests/testControlPanel.py\n+++ b/Products/CMFPlone/exportimport/tests/testControlPanel.py\n@@ -51,9 +51,8 @@ def setUp(self):\n \n \n def test_suite():\n- from unittest import makeSuite\n- from unittest import TestSuite\n+ import unittest\n \n- suite = TestSuite()\n- suite.addTest(makeSuite(ControlPanelXMLAdapterTests))\n- return suite\n+ return unittest.TestSuite((\n+ unittest.defaultTestLoader.loadTestsFromTestCase(ControlPanelXMLAdapterTests),\n+ ))\ndiff --git a/Products/CMFPlone/tests/testNavigationView.py b/Products/CMFPlone/tests/testNavigationView.py\nindex aeddd0ba26..41dcf9f47a 100644\n--- a/Products/CMFPlone/tests/testNavigationView.py\n+++ b/Products/CMFPlone/tests/testNavigationView.py\n@@ -439,12 +439,11 @@ def testBreadcrumbsFilterByInterface2(self):\n \n \n def test_suite():\n- from unittest import makeSuite\n- from unittest import TestSuite\n-\n- suite = TestSuite()\n- suite.addTest(makeSuite(TestCatalogPortalTabs))\n- suite.addTest(makeSuite(TestSiteMap))\n- suite.addTest(makeSuite(TestCatalogBreadCrumbs))\n- suite.addTest(makeSuite(TestPhysicalBreadCrumbs))\n- return suite\n+ import unittest\n+\n+ return unittest.TestSuite((\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestCatalogPortalTabs),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestSiteMap),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestCatalogBreadCrumbs),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestPhysicalBreadCrumbs),\n+ ))\ndiff --git a/Products/CMFPlone/tests/testWebDAV.py b/Products/CMFPlone/tests/testWebDAV.py\nindex e3938407ef..a212bffacc 100644\n--- a/Products/CMFPlone/tests/testWebDAV.py\n+++ b/Products/CMFPlone/tests/testWebDAV.py\n@@ -475,13 +475,15 @@ def test_propfind_folder_index_html_not_exists(self):\n \n \n def test_suite():\n- from unittest import makeSuite\n- from unittest import TestSuite\n+ import unittest\n \n- suite = TestSuite()\n if bbb.HAS_ZSERVER:\n- suite.addTest(makeSuite(TestDAVProperties))\n- suite.addTest(makeSuite(TestPUTObjects))\n- suite.addTest(makeSuite(TestPUTIndexHtml))\n- suite.addTest(makeSuite(TestDAVOperations))\n- return suite\n+ return unittest.TestSuite((\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestDAVProperties),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestPUTObjects),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestPUTIndexHtml),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestDAVOperations),\n+ ))\n+\n+ # return empty suite\n+ return unittest.TestSuite()\n'

Repository: plone.protect
Repository: Products.CMFPlone


Branch: refs/heads/master
Date: 2024-11-27T15:50:03-03:00
Date: 2024-11-28T11:39:00-03:00
Author: Peter Mathis (petschki) <[email protected]>
Commit: https://github.com/plone/plone.protect/commit/085f62cc76cf6055b0a00c7ad2311c7c1e55b15e
Commit: https://github.com/plone/Products.CMFPlone/commit/6de7d4c1d0d2636c1464f06f0f38714539b2c68d

changenote

Files changed:
A news/121.bugfix
A news/4066.bugfix

b'diff --git a/news/121.bugfix b/news/121.bugfix\nnew file mode 100644\nindex 0000000..41e6fd2\n--- /dev/null\n+++ b/news/121.bugfix\n@@ -0,0 +1,2 @@\n+Fix removed `unittest.makeSuite` in python 3.13.\n+[petschki]\n'
b'diff --git a/news/4066.bugfix b/news/4066.bugfix\nnew file mode 100644\nindex 0000000000..da7158af7b\n--- /dev/null\n+++ b/news/4066.bugfix\n@@ -0,0 +1,2 @@\n+Fix removed `unittest.makeSuite` in python 3.13\n+[petschki]\n'

Repository: plone.protect
Repository: Products.CMFPlone


Branch: refs/heads/master
Date: 2024-11-28T11:32:43-03:00
Author: Peter Mathis (petschki) <[email protected]>
Commit: https://github.com/plone/plone.protect/commit/9588d402128332f7d508b98d532876127e6e71c9

black

Files changed:
M plone/protect/tests/testAuthenticator.py
M plone/protect/tests/testPostOnly.py
M plone/protect/tests/testUtils.py

b'diff --git a/plone/protect/tests/testAuthenticator.py b/plone/protect/tests/testAuthenticator.py\nindex 7c7e863..df2e4f6 100644\n--- a/plone/protect/tests/testAuthenticator.py\n+++ b/plone/protect/tests/testAuthenticator.py\n@@ -144,8 +144,10 @@ def func(REQUEST=self.request):\n \n \n def test_suite():\n- return TestSuite((\n- defaultTestLoader.loadTestsFromTestCase(AuthenticatorTests),\n- defaultTestLoader.loadTestsFromTestCase(VerifyTests),\n- defaultTestLoader.loadTestsFromTestCase(DecoratorTests),\n- ))\n+ return TestSuite(\n+ (\n+ defaultTestLoader.loadTestsFromTestCase(AuthenticatorTests),\n+ defaultTestLoader.loadTestsFromTestCase(VerifyTests),\n+ defaultTestLoader.loadTestsFromTestCase(DecoratorTests),\n+ )\n+ )\ndiff --git a/plone/protect/tests/testPostOnly.py b/plone/protect/tests/testPostOnly.py\nindex 0d00356..2561b15 100644\n--- a/plone/protect/tests/testPostOnly.py\n+++ b/plone/protect/tests/testPostOnly.py\n@@ -25,6 +25,4 @@ def testPOSTRequestAllowed(self):\n \n \n def test_suite():\n- return TestSuite((\n- defaultTestLoader.loadTestsFromTestCase(PostOnlyTests),\n- ))\n+ return TestSuite((defaultTestLoader.loadTestsFromTestCase(PostOnlyTests),))\ndiff --git a/plone/protect/tests/testUtils.py b/plone/protect/tests/testUtils.py\nindex b4844a5..7473a1f 100644\n--- a/plone/protect/tests/testUtils.py\n+++ b/plone/protect/tests/testUtils.py\n@@ -71,7 +71,9 @@ def testWithNone(self):\n \n \n def test_suite():\n- return TestSuite((\n- defaultTestLoader.loadTestsFromTestCase(DecoratorTests),\n- defaultTestLoader.loadTestsFromTestCase(UrlTests),\n- ))\n+ return TestSuite(\n+ (\n+ defaultTestLoader.loadTestsFromTestCase(DecoratorTests),\n+ defaultTestLoader.loadTestsFromTestCase(UrlTests),\n+ )\n+ )\n'

Repository: plone.protect


Branch: refs/heads/master
Date: 2024-11-28T22:56:37-03:00
Author: Maurits van Rees (mauritsvanrees) <[email protected]>
Commit: https://github.com/plone/plone.protect/commit/55ba011392e357396d0d220831f402d6e32e9f72
Date: 2024-11-28T23:05:40-03:00
Author: Peter Mathis (petschki) <[email protected]>
Commit: https://github.com/plone/Products.CMFPlone/commit/624c71da695a181eb924702710b53d9b3fa2ce43

Merge pull request #121 from plone/py-3.13-unittest
Merge pull request #4066 from plone/py-3.13-unittest-fix

Fix removed `unittest.makeSuite`in python 3.13
Python 3.13.x: `unittest.makeSuite` got removed.

Files changed:
A news/121.bugfix
M plone/protect/tests/testAuthenticator.py
M plone/protect/tests/testPostOnly.py
M plone/protect/tests/testUtils.py
A news/4066.bugfix
M Products/CMFPlone/exportimport/tests/testControlPanel.py
M Products/CMFPlone/tests/testNavigationView.py
M Products/CMFPlone/tests/testWebDAV.py

b'diff --git a/news/121.bugfix b/news/121.bugfix\nnew file mode 100644\nindex 0000000..41e6fd2\n--- /dev/null\n+++ b/news/121.bugfix\n@@ -0,0 +1,2 @@\n+Fix removed `unittest.makeSuite` in python 3.13.\n+[petschki]\ndiff --git a/plone/protect/tests/testAuthenticator.py b/plone/protect/tests/testAuthenticator.py\nindex ffbb884..df2e4f6 100644\n--- a/plone/protect/tests/testAuthenticator.py\n+++ b/plone/protect/tests/testAuthenticator.py\n@@ -7,7 +7,7 @@\n from plone.protect.authenticator import check\n from plone.protect.tests.case import KeyringTestCase\n from plone.protect.tests.case import MockRequest\n-from unittest import makeSuite\n+from unittest import defaultTestLoader\n from unittest import TestSuite\n from zExceptions import Forbidden\n from ZPublisher.HTTPRequest import HTTPRequest\n@@ -144,8 +144,10 @@ def func(REQUEST=self.request):\n \n \n def test_suite():\n- suite = TestSuite()\n- suite.addTest(makeSuite(AuthenticatorTests))\n- suite.addTest(makeSuite(VerifyTests))\n- suite.addTest(makeSuite(DecoratorTests))\n- return suite\n+ return TestSuite(\n+ (\n+ defaultTestLoader.loadTestsFromTestCase(AuthenticatorTests),\n+ defaultTestLoader.loadTestsFromTestCase(VerifyTests),\n+ defaultTestLoader.loadTestsFromTestCase(DecoratorTests),\n+ )\n+ )\ndiff --git a/plone/protect/tests/testPostOnly.py b/plone/protect/tests/testPostOnly.py\nindex 7654fb1..2561b15 100644\n--- a/plone/protect/tests/testPostOnly.py\n+++ b/plone/protect/tests/testPostOnly.py\n@@ -1,5 +1,5 @@\n from plone.protect.postonly import check\n-from unittest import makeSuite\n+from unittest import defaultTestLoader\n from unittest import TestCase\n from unittest import TestSuite\n from zExceptions import Forbidden\n@@ -25,6 +25,4 @@ def testPOSTRequestAllowed(self):\n \n \n def test_suite():\n- suite = TestSuite()\n- suite.addTest(makeSuite(PostOnlyTests))\n- return suite\n+ return TestSuite((defaultTestLoader.loadTestsFromTestCase(PostOnlyTests),))\ndiff --git a/plone/protect/tests/testUtils.py b/plone/protect/tests/testUtils.py\nindex 5a3bf86..7473a1f 100644\n--- a/plone/protect/tests/testUtils.py\n+++ b/plone/protect/tests/testUtils.py\n@@ -1,7 +1,7 @@\n from plone.protect.testing import PROTECT_FUNCTIONAL_TESTING\n from plone.protect.utils import addTokenToUrl\n from plone.protect.utils import protect\n-from unittest import makeSuite\n+from unittest import defaultTestLoader\n from unittest import TestCase\n from unittest import TestSuite\n \n@@ -71,7 +71,9 @@ def testWithNone(self):\n \n \n def test_suite():\n- suite = TestSuite()\n- suite.addTest(makeSuite(DecoratorTests))\n- suite.addTest(makeSuite(UrlTests))\n- return suite\n+ return TestSuite(\n+ (\n+ defaultTestLoader.loadTestsFromTestCase(DecoratorTests),\n+ defaultTestLoader.loadTestsFromTestCase(UrlTests),\n+ )\n+ )\n'
b'diff --git a/Products/CMFPlone/exportimport/tests/testControlPanel.py b/Products/CMFPlone/exportimport/tests/testControlPanel.py\nindex a3582be816..d78b65ac41 100644\n--- a/Products/CMFPlone/exportimport/tests/testControlPanel.py\n+++ b/Products/CMFPlone/exportimport/tests/testControlPanel.py\n@@ -51,9 +51,8 @@ def setUp(self):\n \n \n def test_suite():\n- from unittest import makeSuite\n- from unittest import TestSuite\n+ import unittest\n \n- suite = TestSuite()\n- suite.addTest(makeSuite(ControlPanelXMLAdapterTests))\n- return suite\n+ return unittest.TestSuite((\n+ unittest.defaultTestLoader.loadTestsFromTestCase(ControlPanelXMLAdapterTests),\n+ ))\ndiff --git a/Products/CMFPlone/tests/testNavigationView.py b/Products/CMFPlone/tests/testNavigationView.py\nindex aeddd0ba26..41dcf9f47a 100644\n--- a/Products/CMFPlone/tests/testNavigationView.py\n+++ b/Products/CMFPlone/tests/testNavigationView.py\n@@ -439,12 +439,11 @@ def testBreadcrumbsFilterByInterface2(self):\n \n \n def test_suite():\n- from unittest import makeSuite\n- from unittest import TestSuite\n-\n- suite = TestSuite()\n- suite.addTest(makeSuite(TestCatalogPortalTabs))\n- suite.addTest(makeSuite(TestSiteMap))\n- suite.addTest(makeSuite(TestCatalogBreadCrumbs))\n- suite.addTest(makeSuite(TestPhysicalBreadCrumbs))\n- return suite\n+ import unittest\n+\n+ return unittest.TestSuite((\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestCatalogPortalTabs),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestSiteMap),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestCatalogBreadCrumbs),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestPhysicalBreadCrumbs),\n+ ))\ndiff --git a/Products/CMFPlone/tests/testWebDAV.py b/Products/CMFPlone/tests/testWebDAV.py\nindex e3938407ef..a212bffacc 100644\n--- a/Products/CMFPlone/tests/testWebDAV.py\n+++ b/Products/CMFPlone/tests/testWebDAV.py\n@@ -475,13 +475,15 @@ def test_propfind_folder_index_html_not_exists(self):\n \n \n def test_suite():\n- from unittest import makeSuite\n- from unittest import TestSuite\n+ import unittest\n \n- suite = TestSuite()\n if bbb.HAS_ZSERVER:\n- suite.addTest(makeSuite(TestDAVProperties))\n- suite.addTest(makeSuite(TestPUTObjects))\n- suite.addTest(makeSuite(TestPUTIndexHtml))\n- suite.addTest(makeSuite(TestDAVOperations))\n- return suite\n+ return unittest.TestSuite((\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestDAVProperties),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestPUTObjects),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestPUTIndexHtml),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestDAVOperations),\n+ ))\n+\n+ # return empty suite\n+ return unittest.TestSuite()\ndiff --git a/news/4066.bugfix b/news/4066.bugfix\nnew file mode 100644\nindex 0000000000..da7158af7b\n--- /dev/null\n+++ b/news/4066.bugfix\n@@ -0,0 +1,2 @@\n+Fix removed `unittest.makeSuite` in python 3.13\n+[petschki]\n'

0 comments on commit d6a8380

Please sign in to comment.