Skip to content

Commit

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

Fix README for removed `unittest.makeSuite`

Files changed:
M src/plone/testing/README.rst
Repository: plone.testing

Branch: refs/heads/master
Date: 2024-11-27T15:54:45-03:00
Author: Peter Mathis (petschki) <[email protected]>
Commit: plone/plone.testing@d6b3fb6

changenote

Files changed:
A news/100.bugfix
Repository: plone.testing

Branch: refs/heads/master
Date: 2024-11-28T11:40:54-03:00
Author: David Glick (davisagli) <[email protected]>
Commit: plone/plone.testing@a7898ce

Merge pull request #100 from plone/unittest-py-3.13

Fix README for removed `unittest.makeSuite`

Files changed:
A news/100.bugfix
M src/plone/testing/README.rst
  • Loading branch information
davisagli committed Nov 28, 2024
1 parent 57742b9 commit 1623c79
Showing 1 changed file with 19 additions and 34 deletions.
53 changes: 19 additions & 34 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,63 +1,48 @@
Repository: plone.theme
Repository: plone.testing


Branch: refs/heads/master
Date: 2024-11-27T15:56:37-03:00
Date: 2024-11-27T15:53:25-03:00
Author: Peter Mathis (petschki) <[email protected]>
Commit: https://github.com/plone/plone.theme/commit/40138abc80a63585ad19240bdc114d5321100314
Commit: https://github.com/plone/plone.testing/commit/dc7bcbb295e338d2e2f2fb7a4999a159dd944c1a

Fix removed `unittest.makeSuite` in python 3.13
Fix README for removed `unittest.makeSuite`

Files changed:
M plone/theme/tests/testBrowserLayerPrecedence.py
M src/plone/testing/README.rst

b'diff --git a/plone/theme/tests/testBrowserLayerPrecedence.py b/plone/theme/tests/testBrowserLayerPrecedence.py\nindex 2c50a56..105d74d 100644\n--- a/plone/theme/tests/testBrowserLayerPrecedence.py\n+++ b/plone/theme/tests/testBrowserLayerPrecedence.py\n@@ -101,11 +101,10 @@ class TestPrecedenceWithNoThemeLayer(LayerPrecedenceTestCase):\n \n \n def test_suite():\n- from unittest import makeSuite\n- from unittest import TestSuite\n-\n- suite = TestSuite()\n- suite.addTest(makeSuite(TestPrecedenceWithAdditiveLayerExtendingInterface))\n- suite.addTest(makeSuite(TestPrecedenceWithAdditiveLayerExtendingDefault))\n- suite.addTest(makeSuite(TestPrecedenceWithNoThemeLayer))\n- return suite\n+ import unittest\n+\n+ return unittest.TestSuite((\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestPrecedenceWithAdditiveLayerExtendingInterface),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestPrecedenceWithAdditiveLayerExtendingDefault),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(TestPrecedenceWithNoThemeLayer),\n+ ))\n'
b"diff --git a/src/plone/testing/README.rst b/src/plone/testing/README.rst\nindex 69fc422..88d48e3 100644\n--- a/src/plone/testing/README.rst\n+++ b/src/plone/testing/README.rst\n@@ -840,14 +840,14 @@ To add the doctests from a particular module to a test suite, you need to use th\n >>> def test_suite():\n ... suite = unittest.TestSuite()\n ... suite.addTests([\n- ... unittest.makeSuite(TestFasterThanLightTravel), # our previous test\n+ ... unittest.defaultTestLoader.loadTestsFromTestCase(TestFasterThanLightTravel), # our previous test\n ... doctest.DocTestSuite('spaceship.utils'),\n ... ])\n ... return suite\n \n Here, we have given the name of the module to check as a string dotted name.\n It is also possible to import a module and pass it as an object.\n-The code above passes a list to ``addTests()``, making it easy to add several sets of tests to the suite: the list can be constructed from calls to ``DocTestSuite()``, ``DocFileSuite()`` (shown below) and ``makeSuite()`` (shown above).\n+The code above passes a list to ``addTests()``, making it easy to add several sets of tests to the suite: the list can be constructed from calls to ``DocTestSuite()``, ``DocFileSuite()`` (shown below) and ``unittest.defaultTestLoader.loadTestsFromTestCase()`` (shown above).\n \n Remember that if you add a ``test_suite()`` function to a module that also has ``TestCase``-derived python tests, those tests will no longer be automatically picked up by ``zope.testing``, so you need to add them to the test suite explicitly.\n \n@@ -901,7 +901,7 @@ For example, if we had a file called ``spaceship.txt`` with doctests, we could a\n >>> def test_suite():\n ... suite = unittest.TestSuite()\n ... suite.addTests([\n- ... unittest.makeSuite(TestFasterThanLightTravel),\n+ ... unittest.defaultTestLoader.loadTestsFromTestCase(TestFasterThanLightTravel),\n ... doctest.DocTestSuite('spaceship.utils'),\n ... doctest.DocFileSuite('spaceship.txt'),\n ... ])\n@@ -920,7 +920,7 @@ It is possible to pass several tests to the suite, e.g.::\n >>> def test_suite():\n ... suite = unittest.TestSuite()\n ... suite.addTests([\n- ... unittest.makeSuite(TestFasterThanLightTravel),\n+ ... unittest.defaultTestLoader.loadTestsFromTestCase(TestFasterThanLightTravel),\n ... doctest.DocTestSuite('spaceship.utils'),\n ... doctest.DocFileSuite('spaceship.txt', 'warpdrive.txt',),\n ... ])\n"

Repository: plone.theme
Repository: plone.testing


Branch: refs/heads/master
Date: 2024-11-27T15:57:40-03:00
Date: 2024-11-27T15:54:45-03:00
Author: Peter Mathis (petschki) <[email protected]>
Commit: https://github.com/plone/plone.theme/commit/ca9d80fc047b7fc05f9ce83551f258838bc9bcf1
Commit: https://github.com/plone/plone.testing/commit/d6b3fb6730a3bbaca9f5d6d8993376de612b19d0

changenote

Files changed:
A news/27.bugfix
A news/100.bugfix

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

Repository: plone.theme
Repository: plone.testing


Branch: refs/heads/master
Date: 2024-11-28T10:29:39-03:00
Date: 2024-11-28T11:40:54-03:00
Author: David Glick (davisagli) <[email protected]>
Commit: https://github.com/plone/plone.theme/commit/6c98c57e29b708e60aeaf462ba487eb1875040c1
Commit: https://github.com/plone/plone.testing/commit/a7898ce728ad683f8758bebda5739d1d51a6fdcd

black
Merge pull request #100 from plone/unittest-py-3.13

Files changed:
M plone/theme/tests/testBrowserLayerPrecedence.py

b'diff --git a/plone/theme/tests/testBrowserLayerPrecedence.py b/plone/theme/tests/testBrowserLayerPrecedence.py\nindex 105d74d..90e0da1 100644\n--- a/plone/theme/tests/testBrowserLayerPrecedence.py\n+++ b/plone/theme/tests/testBrowserLayerPrecedence.py\n@@ -103,8 +103,16 @@ class TestPrecedenceWithNoThemeLayer(LayerPrecedenceTestCase):\n def test_suite():\n import unittest\n \n- return unittest.TestSuite((\n- unittest.defaultTestLoader.loadTestsFromTestCase(TestPrecedenceWithAdditiveLayerExtendingInterface),\n- unittest.defaultTestLoader.loadTestsFromTestCase(TestPrecedenceWithAdditiveLayerExtendingDefault),\n- unittest.defaultTestLoader.loadTestsFromTestCase(TestPrecedenceWithNoThemeLayer),\n- ))\n+ return unittest.TestSuite(\n+ (\n+ unittest.defaultTestLoader.loadTestsFromTestCase(\n+ TestPrecedenceWithAdditiveLayerExtendingInterface\n+ ),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(\n+ TestPrecedenceWithAdditiveLayerExtendingDefault\n+ ),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(\n+ TestPrecedenceWithNoThemeLayer\n+ ),\n+ )\n+ )\n'

Repository: plone.theme


Branch: refs/heads/master
Date: 2024-11-28T11:39:26-03:00
Author: David Glick (davisagli) <[email protected]>
Commit: https://github.com/plone/plone.theme/commit/81406c9c9f3e759a28f38e4ef5a16bc19d3903cc

Merge pull request #27 from plone/py-3.13-unittest

Fix removed `unittest.makeSuite` in python 3.13
Fix README for removed `unittest.makeSuite`

Files changed:
A news/27.bugfix
M plone/theme/tests/testBrowserLayerPrecedence.py
A news/100.bugfix
M src/plone/testing/README.rst

b'diff --git a/news/27.bugfix b/news/27.bugfix\nnew file mode 100644\nindex 0000000..41e6fd2\n--- /dev/null\n+++ b/news/27.bugfix\n@@ -0,0 +1,2 @@\n+Fix removed `unittest.makeSuite` in python 3.13.\n+[petschki]\ndiff --git a/plone/theme/tests/testBrowserLayerPrecedence.py b/plone/theme/tests/testBrowserLayerPrecedence.py\nindex 2c50a56..90e0da1 100644\n--- a/plone/theme/tests/testBrowserLayerPrecedence.py\n+++ b/plone/theme/tests/testBrowserLayerPrecedence.py\n@@ -101,11 +101,18 @@ class TestPrecedenceWithNoThemeLayer(LayerPrecedenceTestCase):\n \n \n def test_suite():\n- from unittest import makeSuite\n- from unittest import TestSuite\n-\n- suite = TestSuite()\n- suite.addTest(makeSuite(TestPrecedenceWithAdditiveLayerExtendingInterface))\n- suite.addTest(makeSuite(TestPrecedenceWithAdditiveLayerExtendingDefault))\n- suite.addTest(makeSuite(TestPrecedenceWithNoThemeLayer))\n- return suite\n+ import unittest\n+\n+ return unittest.TestSuite(\n+ (\n+ unittest.defaultTestLoader.loadTestsFromTestCase(\n+ TestPrecedenceWithAdditiveLayerExtendingInterface\n+ ),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(\n+ TestPrecedenceWithAdditiveLayerExtendingDefault\n+ ),\n+ unittest.defaultTestLoader.loadTestsFromTestCase(\n+ TestPrecedenceWithNoThemeLayer\n+ ),\n+ )\n+ )\n'
b"diff --git a/news/100.bugfix b/news/100.bugfix\nnew file mode 100644\nindex 0000000..cdd0f35\n--- /dev/null\n+++ b/news/100.bugfix\n@@ -0,0 +1,2 @@\n+Fix README for removed `unittest.makeSuite` in python 3.13.\n+[petschki]\ndiff --git a/src/plone/testing/README.rst b/src/plone/testing/README.rst\nindex 69fc422..88d48e3 100644\n--- a/src/plone/testing/README.rst\n+++ b/src/plone/testing/README.rst\n@@ -840,14 +840,14 @@ To add the doctests from a particular module to a test suite, you need to use th\n >>> def test_suite():\n ... suite = unittest.TestSuite()\n ... suite.addTests([\n- ... unittest.makeSuite(TestFasterThanLightTravel), # our previous test\n+ ... unittest.defaultTestLoader.loadTestsFromTestCase(TestFasterThanLightTravel), # our previous test\n ... doctest.DocTestSuite('spaceship.utils'),\n ... ])\n ... return suite\n \n Here, we have given the name of the module to check as a string dotted name.\n It is also possible to import a module and pass it as an object.\n-The code above passes a list to ``addTests()``, making it easy to add several sets of tests to the suite: the list can be constructed from calls to ``DocTestSuite()``, ``DocFileSuite()`` (shown below) and ``makeSuite()`` (shown above).\n+The code above passes a list to ``addTests()``, making it easy to add several sets of tests to the suite: the list can be constructed from calls to ``DocTestSuite()``, ``DocFileSuite()`` (shown below) and ``unittest.defaultTestLoader.loadTestsFromTestCase()`` (shown above).\n \n Remember that if you add a ``test_suite()`` function to a module that also has ``TestCase``-derived python tests, those tests will no longer be automatically picked up by ``zope.testing``, so you need to add them to the test suite explicitly.\n \n@@ -901,7 +901,7 @@ For example, if we had a file called ``spaceship.txt`` with doctests, we could a\n >>> def test_suite():\n ... suite = unittest.TestSuite()\n ... suite.addTests([\n- ... unittest.makeSuite(TestFasterThanLightTravel),\n+ ... unittest.defaultTestLoader.loadTestsFromTestCase(TestFasterThanLightTravel),\n ... doctest.DocTestSuite('spaceship.utils'),\n ... doctest.DocFileSuite('spaceship.txt'),\n ... ])\n@@ -920,7 +920,7 @@ It is possible to pass several tests to the suite, e.g.::\n >>> def test_suite():\n ... suite = unittest.TestSuite()\n ... suite.addTests([\n- ... unittest.makeSuite(TestFasterThanLightTravel),\n+ ... unittest.defaultTestLoader.loadTestsFromTestCase(TestFasterThanLightTravel),\n ... doctest.DocTestSuite('spaceship.utils'),\n ... doctest.DocFileSuite('spaceship.txt', 'warpdrive.txt',),\n ... ])\n"

0 comments on commit 1623c79

Please sign in to comment.