From a190a6d0b3d3195d8a5707488a762c53eaa7e817 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sat, 15 Jun 2024 20:43:03 +0200 Subject: [PATCH] Apply Fedora patch for using default test loader. --- genshi/filters/tests/i18n.py | 12 ++++++------ genshi/filters/tests/test_html.py | 4 ++-- genshi/filters/tests/transform.py | 2 +- genshi/template/tests/base.py | 2 +- genshi/template/tests/directives.py | 20 ++++++++++---------- genshi/template/tests/eval.py | 4 ++-- genshi/template/tests/interpolation.py | 2 +- genshi/template/tests/loader.py | 2 +- genshi/template/tests/markup.py | 2 +- genshi/template/tests/plugin.py | 4 ++-- genshi/template/tests/text.py | 4 ++-- genshi/tests/builder.py | 2 +- genshi/tests/core.py | 10 +++++----- genshi/tests/input.py | 4 ++-- genshi/tests/output.py | 8 ++++---- genshi/tests/path.py | 2 +- genshi/tests/util.py | 2 +- 17 files changed, 43 insertions(+), 43 deletions(-) diff --git a/genshi/filters/tests/i18n.py b/genshi/filters/tests/i18n.py index 18548f23..8b4ace05 100644 --- a/genshi/filters/tests/i18n.py +++ b/genshi/filters/tests/i18n.py @@ -2203,12 +2203,12 @@ def test_translate_context_with_msg(self): def suite(): suite = unittest.TestSuite() suite.addTest(doctest_suite(Translator.__module__)) - suite.addTest(unittest.makeSuite(TranslatorTestCase, 'test')) - suite.addTest(unittest.makeSuite(MsgDirectiveTestCase, 'test')) - suite.addTest(unittest.makeSuite(ChooseDirectiveTestCase, 'test')) - suite.addTest(unittest.makeSuite(DomainDirectiveTestCase, 'test')) - suite.addTest(unittest.makeSuite(ExtractTestCase, 'test')) - suite.addTest(unittest.makeSuite(ContextDirectiveTestCase, 'test')) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(TranslatorTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(MsgDirectiveTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ChooseDirectiveTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(DomainDirectiveTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ExtractTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ContextDirectiveTestCase)) return suite if __name__ == '__main__': diff --git a/genshi/filters/tests/test_html.py b/genshi/filters/tests/test_html.py index a5fc71bd..c356675d 100644 --- a/genshi/filters/tests/test_html.py +++ b/genshi/filters/tests/test_html.py @@ -614,8 +614,8 @@ def test_sanitize_unicode_url(self): def suite(): suite = unittest.TestSuite() suite.addTest(doctest_suite(HTMLFormFiller.__module__)) - suite.addTest(unittest.makeSuite(HTMLFormFillerTestCase, 'test')) - suite.addTest(unittest.makeSuite(HTMLSanitizerTestCase, 'test')) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(HTMLFormFillerTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(HTMLSanitizerTestCase)) return suite diff --git a/genshi/filters/tests/transform.py b/genshi/filters/tests/transform.py index 62015573..baa5ae5e 100644 --- a/genshi/filters/tests/transform.py +++ b/genshi/filters/tests/transform.py @@ -1492,7 +1492,7 @@ def suite(): EmptyTest, RemoveTest, UnwrapText, WrapTest, FilterTest, MapTest, SubstituteTest, RenameTest, ReplaceTest, BeforeTest, AfterTest, PrependTest, AppendTest, AttrTest, CopyTest, CutTest): - suite.addTest(unittest.makeSuite(test, 'test')) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(test)) suite.addTest(doctest_suite( genshi.filters.transform, optionflags=doctest.NORMALIZE_WHITESPACE, extraglobs={'HTML': HTML, 'tag': tag, 'Markup': Markup})) diff --git a/genshi/template/tests/base.py b/genshi/template/tests/base.py index e832f3a5..39257dfb 100644 --- a/genshi/template/tests/base.py +++ b/genshi/template/tests/base.py @@ -35,7 +35,7 @@ def test_copy(self): def suite(): suite = unittest.TestSuite() suite.addTest(doctest.DocTestSuite(Template.__module__)) - suite.addTest(unittest.makeSuite(ContextTestCase, 'test')) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ContextTestCase)) return suite if __name__ == '__main__': diff --git a/genshi/template/tests/directives.py b/genshi/template/tests/directives.py index 5a17799f..389f8599 100644 --- a/genshi/template/tests/directives.py +++ b/genshi/template/tests/directives.py @@ -1217,16 +1217,16 @@ def test_with_empty_value(self): def suite(): suite = unittest.TestSuite() suite.addTest(doctest.DocTestSuite(directives)) - suite.addTest(unittest.makeSuite(AttrsDirectiveTestCase, 'test')) - suite.addTest(unittest.makeSuite(ChooseDirectiveTestCase, 'test')) - suite.addTest(unittest.makeSuite(DefDirectiveTestCase, 'test')) - suite.addTest(unittest.makeSuite(ForDirectiveTestCase, 'test')) - suite.addTest(unittest.makeSuite(IfDirectiveTestCase, 'test')) - suite.addTest(unittest.makeSuite(MatchDirectiveTestCase, 'test')) - suite.addTest(unittest.makeSuite(ContentDirectiveTestCase, 'test')) - suite.addTest(unittest.makeSuite(ReplaceDirectiveTestCase, 'test')) - suite.addTest(unittest.makeSuite(StripDirectiveTestCase, 'test')) - suite.addTest(unittest.makeSuite(WithDirectiveTestCase, 'test')) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(AttrsDirectiveTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ChooseDirectiveTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(DefDirectiveTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ForDirectiveTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(IfDirectiveTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(MatchDirectiveTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ContentDirectiveTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ReplaceDirectiveTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(StripDirectiveTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(WithDirectiveTestCase)) return suite if __name__ == '__main__': diff --git a/genshi/template/tests/eval.py b/genshi/template/tests/eval.py index 5dbb348f..390cca5b 100644 --- a/genshi/template/tests/eval.py +++ b/genshi/template/tests/eval.py @@ -1037,8 +1037,8 @@ def __init__(self): def suite(): suite = unittest.TestSuite() suite.addTest(doctest.DocTestSuite(Expression.__module__)) - suite.addTest(unittest.makeSuite(ExpressionTestCase, 'test')) - suite.addTest(unittest.makeSuite(SuiteTestCase, 'test')) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ExpressionTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(SuiteTestCase)) return suite if __name__ == '__main__': diff --git a/genshi/template/tests/interpolation.py b/genshi/template/tests/interpolation.py index 65be21d7..575c71d6 100644 --- a/genshi/template/tests/interpolation.py +++ b/genshi/template/tests/interpolation.py @@ -195,7 +195,7 @@ def test_interpolate_triplequoted(self): def suite(): suite = unittest.TestSuite() suite.addTest(doctest.DocTestSuite(interpolate.__module__)) - suite.addTest(unittest.makeSuite(InterpolateTestCase, 'test')) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(InterpolateTestCase)) return suite if __name__ == '__main__': diff --git a/genshi/template/tests/loader.py b/genshi/template/tests/loader.py index 1b9612b7..aa842b5e 100644 --- a/genshi/template/tests/loader.py +++ b/genshi/template/tests/loader.py @@ -522,7 +522,7 @@ def test_prefix_delegation_to_directories_with_subdirs(self): def suite(): suite = unittest.TestSuite() suite.addTest(doctest.DocTestSuite(TemplateLoader.__module__)) - suite.addTest(unittest.makeSuite(TemplateLoaderTestCase, 'test')) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(TemplateLoaderTestCase)) return suite if __name__ == '__main__': diff --git a/genshi/template/tests/markup.py b/genshi/template/tests/markup.py index 8c5be567..f10d548e 100644 --- a/genshi/template/tests/markup.py +++ b/genshi/template/tests/markup.py @@ -802,7 +802,7 @@ def test_directive_single_line_with_translator(self): def suite(): suite = unittest.TestSuite() suite.addTest(doctest.DocTestSuite(MarkupTemplate.__module__)) - suite.addTest(unittest.makeSuite(MarkupTemplateTestCase, 'test')) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(MarkupTemplateTestCase)) return suite if __name__ == '__main__': diff --git a/genshi/template/tests/plugin.py b/genshi/template/tests/plugin.py index 93355e0e..83e1990b 100644 --- a/genshi/template/tests/plugin.py +++ b/genshi/template/tests/plugin.py @@ -256,8 +256,8 @@ def test_helper_functions(self): def suite(): suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(MarkupTemplateEnginePluginTestCase, 'test')) - suite.addTest(unittest.makeSuite(TextTemplateEnginePluginTestCase, 'test')) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(MarkupTemplateEnginePluginTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(TextTemplateEnginePluginTestCase)) return suite if __name__ == '__main__': diff --git a/genshi/template/tests/text.py b/genshi/template/tests/text.py index 3973df6f..d49a0797 100644 --- a/genshi/template/tests/text.py +++ b/genshi/template/tests/text.py @@ -295,8 +295,8 @@ def test_include_expr(self): def suite(): suite = unittest.TestSuite() suite.addTest(doctest.DocTestSuite(NewTextTemplate.__module__)) - suite.addTest(unittest.makeSuite(OldTextTemplateTestCase, 'test')) - suite.addTest(unittest.makeSuite(NewTextTemplateTestCase, 'test')) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(OldTextTemplateTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(NewTextTemplateTestCase)) return suite if __name__ == '__main__': diff --git a/genshi/tests/builder.py b/genshi/tests/builder.py index e322d9bc..1859c94f 100644 --- a/genshi/tests/builder.py +++ b/genshi/tests/builder.py @@ -67,7 +67,7 @@ def test_markup_escape(self): def suite(): suite = unittest.TestSuite() suite.addTest(doctest.DocTestSuite(Element.__module__)) - suite.addTest(unittest.makeSuite(ElementFactoryTestCase, 'test')) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ElementFactoryTestCase)) return suite diff --git a/genshi/tests/core.py b/genshi/tests/core.py index e7e7906d..27d33aa3 100644 --- a/genshi/tests/core.py +++ b/genshi/tests/core.py @@ -256,11 +256,11 @@ def test_curly_brace_equality(self): def suite(): suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(StreamTestCase, 'test')) - suite.addTest(unittest.makeSuite(MarkupTestCase, 'test')) - suite.addTest(unittest.makeSuite(NamespaceTestCase, 'test')) - suite.addTest(unittest.makeSuite(AttrsTestCase, 'test')) - suite.addTest(unittest.makeSuite(QNameTestCase, 'test')) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(StreamTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(MarkupTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(NamespaceTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(AttrsTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(QNameTestCase)) suite.addTest(doctest_suite(core)) return suite diff --git a/genshi/tests/input.py b/genshi/tests/input.py index fbee8403..cddbdd4d 100644 --- a/genshi/tests/input.py +++ b/genshi/tests/input.py @@ -297,8 +297,8 @@ def test_convert_ElementTree_to_markup_stream(self): def suite(): suite = unittest.TestSuite() suite.addTest(doctest_suite(XMLParser.__module__)) - suite.addTest(unittest.makeSuite(XMLParserTestCase, 'test')) - suite.addTest(unittest.makeSuite(HTMLParserTestCase, 'test')) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(XMLParserTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(HTMLParserTestCase)) return suite if __name__ == '__main__': diff --git a/genshi/tests/output.py b/genshi/tests/output.py index aa4c81ad..29c4fe5c 100644 --- a/genshi/tests/output.py +++ b/genshi/tests/output.py @@ -469,10 +469,10 @@ def test_elem_content(self): def suite(): suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(XMLSerializerTestCase, 'test')) - suite.addTest(unittest.makeSuite(XHTMLSerializerTestCase, 'test')) - suite.addTest(unittest.makeSuite(HTMLSerializerTestCase, 'test')) - suite.addTest(unittest.makeSuite(EmptyTagFilterTestCase, 'test')) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(XMLSerializerTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(XHTMLSerializerTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(HTMLSerializerTestCase)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(EmptyTagFilterTestCase)) suite.addTest(doctest_suite(XMLSerializer.__module__)) return suite diff --git a/genshi/tests/path.py b/genshi/tests/path.py index afa3a3d9..b095261f 100644 --- a/genshi/tests/path.py +++ b/genshi/tests/path.py @@ -709,7 +709,7 @@ def _test_eval(self, path, equiv=None, input=None, output='', def suite(): suite = unittest.TestSuite() suite.addTest(doctest_suite(Path.__module__)) - suite.addTest(unittest.makeSuite(PathTestCase, 'test')) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(PathTestCase)) return suite diff --git a/genshi/tests/util.py b/genshi/tests/util.py index 4556d11a..6a180468 100644 --- a/genshi/tests/util.py +++ b/genshi/tests/util.py @@ -87,7 +87,7 @@ def test_getitem(self): def suite(): suite = unittest.TestSuite() suite.addTest(doctest_suite(util)) - suite.addTest(unittest.makeSuite(LRUCacheTestCase, 'test')) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(LRUCacheTestCase)) return suite if __name__ == '__main__':