From 25277a0b65e475c36abd90546aa7a434e90727bf Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Wed, 2 Oct 2024 10:14:22 +0200 Subject: [PATCH] avoid testing deprecation errors with Python3.12 --- cybertools/brain/tests.py | 8 ++++---- cybertools/browser/tests.py | 5 +++-- cybertools/catalog/tests.py | 7 +++---- cybertools/commerce/tests.py | 7 +++---- cybertools/composer/layout/tests.py | 7 ++++--- cybertools/composer/message/tests.py | 7 ++++--- cybertools/composer/report/tests.py | 7 ++++--- cybertools/composer/rule/tests.py | 7 ++++--- cybertools/composer/schema/tests.py | 7 ++++--- cybertools/composer/tests.py | 7 ++++--- cybertools/docgen/tests.py | 9 ++++----- cybertools/integrator/tests/test_filesystem.py | 7 ++++--- cybertools/knowledge/survey/tests.py | 7 +++---- cybertools/knowledge/tests.py | 7 +++---- cybertools/link/tests.py | 6 +++--- cybertools/media/tests.py | 13 +++++-------- cybertools/organize/tests.py | 7 +++---- cybertools/process/tests.py | 6 +++--- cybertools/relation/tests.py | 6 +++--- cybertools/reporter/tests.py | 8 ++++---- cybertools/stateful/tests.py | 4 ++-- cybertools/storage/tests.py | 7 +++---- cybertools/text/tests.py | 5 ++--- 23 files changed, 79 insertions(+), 82 deletions(-) diff --git a/cybertools/brain/tests.py b/cybertools/brain/tests.py index 2941a48..4032d34 100755 --- a/cybertools/brain/tests.py +++ b/cybertools/brain/tests.py @@ -1,3 +1,4 @@ +# cybertools.brain.tests import unittest, doctest from zope.interface.verify import verifyClass @@ -18,10 +19,9 @@ class TestBrain(unittest.TestCase): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(TestBrain), - doctest.DocFileSuite('README.txt', - optionflags=flags,), - )) + unittest.TestLoader().loadTestsFromTestCase(TestBrain), + doctest.DocFileSuite('README.txt', optionflags=flags,), + )) if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/cybertools/browser/tests.py b/cybertools/browser/tests.py index ad58fb2..12bd197 100755 --- a/cybertools/browser/tests.py +++ b/cybertools/browser/tests.py @@ -1,3 +1,4 @@ +# cybertools.browser.tests import unittest, doctest from zope.app.testing import ztapi @@ -7,8 +8,8 @@ from zope.interface.verify import verifyClass def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - doctest.DocFileSuite('README.txt', optionflags=flags), - )) + doctest.DocFileSuite('README.txt', optionflags=flags), + )) if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/cybertools/catalog/tests.py b/cybertools/catalog/tests.py index 8421f20..c9760f0 100755 --- a/cybertools/catalog/tests.py +++ b/cybertools/catalog/tests.py @@ -1,7 +1,6 @@ -#! /usr/bin/python +# cybertools.catalog.tests -""" -Tests for the 'cybertools.catalog' package. +""" Tests for the 'cybertools.catalog' package. """ import unittest, doctest @@ -17,7 +16,7 @@ class Test(unittest.TestCase): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(Test), + unittest.TestLoader().loadTestsFromTestCase(Test), doctest.DocFileSuite('README.txt', optionflags=flags), )) diff --git a/cybertools/commerce/tests.py b/cybertools/commerce/tests.py index 53bb80e..31ed7d3 100755 --- a/cybertools/commerce/tests.py +++ b/cybertools/commerce/tests.py @@ -1,7 +1,6 @@ -#! /usr/bin/python +# cybertools.commerce.tests -""" -Tests for the 'cybertools.commerce' package. +""" Tests for the 'cybertools.commerce' package. """ import unittest, doctest @@ -58,7 +57,7 @@ class Test(unittest.TestCase): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(Test), + unittest.TestLoader().loadTestsFromTestCase(Test), doctest.DocFileSuite('README.txt', optionflags=flags, setUp=setUp, tearDown=tearDown), )) diff --git a/cybertools/composer/layout/tests.py b/cybertools/composer/layout/tests.py index e29defd..d368343 100755 --- a/cybertools/composer/layout/tests.py +++ b/cybertools/composer/layout/tests.py @@ -1,3 +1,4 @@ +# cybertools.composer.layout.tests import unittest, doctest @@ -12,9 +13,9 @@ class Test(unittest.TestCase): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(Test), - doctest.DocFileSuite('README.txt', optionflags=flags), - )) + unittest.TestLoader().loadTestsFromTestCase(Test), + doctest.DocFileSuite('README.txt', optionflags=flags), + )) if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/cybertools/composer/message/tests.py b/cybertools/composer/message/tests.py index 44129f7..31a415b 100755 --- a/cybertools/composer/message/tests.py +++ b/cybertools/composer/message/tests.py @@ -1,3 +1,4 @@ +# cybertools.composer.message.tests import unittest, doctest @@ -12,9 +13,9 @@ class Test(unittest.TestCase): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(Test), - doctest.DocFileSuite('README.txt', optionflags=flags), - )) + unittest.TestLoader().loadTestsFromTestCase(Test), + doctest.DocFileSuite('README.txt', optionflags=flags), + )) if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/cybertools/composer/report/tests.py b/cybertools/composer/report/tests.py index 44129f7..c515203 100755 --- a/cybertools/composer/report/tests.py +++ b/cybertools/composer/report/tests.py @@ -1,3 +1,4 @@ +# composer.report.tests import unittest, doctest @@ -12,9 +13,9 @@ class Test(unittest.TestCase): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(Test), - doctest.DocFileSuite('README.txt', optionflags=flags), - )) + unittest.TestLoader().loadTestsFromTestCase(Test), + doctest.DocFileSuite('README.txt', optionflags=flags), + )) if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/cybertools/composer/rule/tests.py b/cybertools/composer/rule/tests.py index a515f98..24cef8c 100755 --- a/cybertools/composer/rule/tests.py +++ b/cybertools/composer/rule/tests.py @@ -1,3 +1,4 @@ +# cybertools.composer.rule.tests import unittest, doctest from email import message_from_string @@ -27,9 +28,9 @@ class Test(unittest.TestCase): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(Test), - doctest.DocFileSuite('README.txt', optionflags=flags), - )) + unittest.TestLoader().loadTestsFromTestCase(Test), + doctest.DocFileSuite('README.txt', optionflags=flags), + )) if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/cybertools/composer/schema/tests.py b/cybertools/composer/schema/tests.py index 68fdf26..0c6d170 100755 --- a/cybertools/composer/schema/tests.py +++ b/cybertools/composer/schema/tests.py @@ -1,3 +1,4 @@ +# cybertools.composer.schema.tests import unittest, doctest @@ -12,9 +13,9 @@ class Test(unittest.TestCase): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(Test), - doctest.DocFileSuite('README.txt', optionflags=flags), - )) + unittest.TestLoader().loadTestsFromTestCase(Test), + doctest.DocFileSuite('README.txt', optionflags=flags), + )) if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/cybertools/composer/tests.py b/cybertools/composer/tests.py index 674c681..63f7fa4 100755 --- a/cybertools/composer/tests.py +++ b/cybertools/composer/tests.py @@ -1,3 +1,4 @@ +# cybertools.composer.tests import unittest, doctest @@ -12,9 +13,9 @@ class Test(unittest.TestCase): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(Test), - doctest.DocFileSuite('README.txt', optionflags=flags), - )) + unittest.TestLoader().loadTestsFromTestCase(Test), + doctest.DocFileSuite('README.txt', optionflags=flags), + )) if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/cybertools/docgen/tests.py b/cybertools/docgen/tests.py index 16f621b..9cb6c07 100755 --- a/cybertools/docgen/tests.py +++ b/cybertools/docgen/tests.py @@ -1,7 +1,6 @@ # cybertools.util.docgen.tests -""" -unit tests, doc tests +""" unit tests, doc tests """ import unittest, doctest @@ -20,9 +19,9 @@ class Test(unittest.TestCase): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(Test), - doctest.DocFileSuite('README.txt', optionflags=flags), - )) + unittest.TestLoader().loadTestsFromTestCase(Test), + doctest.DocFileSuite('README.txt', optionflags=flags), + )) if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/cybertools/integrator/tests/test_filesystem.py b/cybertools/integrator/tests/test_filesystem.py index 23c7f03..7d672d3 100755 --- a/cybertools/integrator/tests/test_filesystem.py +++ b/cybertools/integrator/tests/test_filesystem.py @@ -1,3 +1,4 @@ +# cybertools.integrator.tests.test_filesystem import os import unittest, doctest @@ -19,9 +20,9 @@ class Test(unittest.TestCase): def test_suite(): return unittest.TestSuite(( - unittest.makeSuite(Test), - doctest.DocFileSuite('../filesystem.txt', optionflags=flags), - )) + unittest.TestLoader().loadTestsFromTestCase(Test), + doctest.DocFileSuite('../filesystem.txt', optionflags=flags), + )) if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/cybertools/knowledge/survey/tests.py b/cybertools/knowledge/survey/tests.py index 514a4d3..e302233 100644 --- a/cybertools/knowledge/survey/tests.py +++ b/cybertools/knowledge/survey/tests.py @@ -1,7 +1,6 @@ -#! /usr/bin/python +# cybertools.knowledge.survey.tests -""" -Tests for the 'cybertools.knowledge.survey' package. +""" Tests for the 'cybertools.knowledge.survey' package. """ import unittest, doctest @@ -18,7 +17,7 @@ class TestSurvey(unittest.TestCase): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(TestSurvey), + unittest.TestLoader().loadTestsFromTestCase(TestSurvey), doctest.DocFileSuite('README.txt', optionflags=flags), )) diff --git a/cybertools/knowledge/tests.py b/cybertools/knowledge/tests.py index 6283acf..d30b25c 100755 --- a/cybertools/knowledge/tests.py +++ b/cybertools/knowledge/tests.py @@ -1,7 +1,6 @@ -#! /usr/bin/python +# cybertools.knowledge.tests -""" -Tests for the 'cybertools.knowledge' package. +""" Tests for the 'cybertools.knowledge' package. """ import unittest, doctest @@ -17,7 +16,7 @@ class TestKnowledge(unittest.TestCase): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(TestKnowledge), + unittest.TestLoader().loadTestsFromTestCase(TestKnowledge), doctest.DocFileSuite('README.txt', optionflags=flags), )) diff --git a/cybertools/link/tests.py b/cybertools/link/tests.py index 7569fc1..f4bb23a 100755 --- a/cybertools/link/tests.py +++ b/cybertools/link/tests.py @@ -41,9 +41,9 @@ class TestLink(unittest.TestCase): def test_suite(): return unittest.TestSuite(( - unittest.makeSuite(TestLink), - doctest.DocFileSuite('README.txt'), - )) + unittest.TestLoader().loadTestsFromTestCase(TestLink), + doctest.DocFileSuite('README.txt'), + )) if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/cybertools/media/tests.py b/cybertools/media/tests.py index b62181a..a8f32dc 100644 --- a/cybertools/media/tests.py +++ b/cybertools/media/tests.py @@ -1,9 +1,6 @@ -#! /usr/bin/python +# cybertools.media.tests -""" -Tests for the 'cybertools.media' package. - -$Id$ +""" Tests for the 'cybertools.media' package. """ import os @@ -35,9 +32,9 @@ class Test(unittest.TestCase): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(Test), - doctest.DocFileSuite('README.txt', optionflags=flags), - )) + unittest.TestLoader().loadTestsFromTestCase(Test), + doctest.DocFileSuite('README.txt', optionflags=flags), + )) if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/cybertools/organize/tests.py b/cybertools/organize/tests.py index cd511ea..692d925 100755 --- a/cybertools/organize/tests.py +++ b/cybertools/organize/tests.py @@ -1,7 +1,6 @@ -#! /usr/bin/python +# cybertools.organize.tests -""" -Tests for the 'cybertools.organize' package. +""" Tests for the 'cybertools.organize' package. """ import unittest, doctest @@ -34,7 +33,7 @@ def setUp(site): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(TestParty), + unittest.TestLoader().loadTestsFromTestCase(TestParty), doctest.DocFileSuite('README.txt', optionflags=flags), doctest.DocFileSuite('formmanager.txt', optionflags=flags), doctest.DocFileSuite('servicemanager.txt', optionflags=flags), diff --git a/cybertools/process/tests.py b/cybertools/process/tests.py index f5316d2..c3844ea 100755 --- a/cybertools/process/tests.py +++ b/cybertools/process/tests.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +# cybertools.process.tests """ Tests for the 'cybertools.process' package. @@ -7,7 +7,7 @@ Tests for the 'cybertools.process' package. import unittest, doctest from cybertools.process.definition import Process -class TestProcess(unittest.TestCase): +class Test(unittest.TestCase): "Basic tests for the process package." def testBasicStuff(self): @@ -17,7 +17,7 @@ class TestProcess(unittest.TestCase): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(TestProcess), + unittest.TestLoader().loadTestsFromTestCase(Test), doctest.DocFileSuite('README.txt', optionflags=flags), )) diff --git a/cybertools/relation/tests.py b/cybertools/relation/tests.py index 3142bf8..9d62a13 100755 --- a/cybertools/relation/tests.py +++ b/cybertools/relation/tests.py @@ -59,9 +59,9 @@ class TestRelation(unittest.TestCase): def test_suite(): return unittest.TestSuite(( - unittest.makeSuite(TestRelation), - doctest.DocFileSuite('README.txt'), - )) + unittest.TestLoader().loadTestsFromTestCase(TestRelation), + doctest.DocFileSuite('README.txt'), + )) if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/cybertools/reporter/tests.py b/cybertools/reporter/tests.py index 7a6e195..3427f4c 100755 --- a/cybertools/reporter/tests.py +++ b/cybertools/reporter/tests.py @@ -7,7 +7,7 @@ from zope.interface.verify import verifyClass from cybertools.reporter.interfaces import IResultSet, IRow, ICell -class TestReporter(unittest.TestCase): +class Test(unittest.TestCase): "Basic tests for the reporter package." def testInterfaces(self): @@ -17,9 +17,9 @@ class TestReporter(unittest.TestCase): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(TestReporter), - doctest.DocFileSuite('README.txt', optionflags=flags), - )) + unittest.TestLoader().loadTestsFromTestCase(Test), + doctest.DocFileSuite('README.txt', optionflags=flags), + )) if __name__ == '__main__': unittest.main(defaultTest='test_suite') diff --git a/cybertools/stateful/tests.py b/cybertools/stateful/tests.py index c3f3bd9..346745f 100755 --- a/cybertools/stateful/tests.py +++ b/cybertools/stateful/tests.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +# cybertools.stateful.tests """ Tests for the 'cybertools.stateful' package. @@ -17,7 +17,7 @@ class Test(unittest.TestCase): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(Test), + unittest.TestLoader().loadTestsFromTestCase(Test), doctest.DocFileSuite('README.txt', optionflags=flags), )) diff --git a/cybertools/storage/tests.py b/cybertools/storage/tests.py index e861a44..0861a14 100755 --- a/cybertools/storage/tests.py +++ b/cybertools/storage/tests.py @@ -1,7 +1,6 @@ -#! /usr/bin/python +# cybertools.storage.tests -""" -Tests for the 'cybertools.storage' package. +""" Tests for the 'cybertools.storage' package. """ import unittest, doctest @@ -17,7 +16,7 @@ class Test(unittest.TestCase): def test_suite(): flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS return unittest.TestSuite(( - unittest.makeSuite(Test), + unittest.TestLoader().loadTestsFromTestCase(Test), doctest.DocFileSuite('README.txt', optionflags=flags), )) diff --git a/cybertools/text/tests.py b/cybertools/text/tests.py index 83451aa..08c221d 100755 --- a/cybertools/text/tests.py +++ b/cybertools/text/tests.py @@ -1,7 +1,6 @@ -#! /usr/bin/python +# cybertools.text.tests -""" -Tests for the 'cybertools.text' package. +""" Tests for the 'cybertools.text' package. """ import unittest, doctest