Skip to content

Commit

Permalink
Apply Fedora patch for using default test loader.
Browse files Browse the repository at this point in the history
  • Loading branch information
hodgestar committed Jun 15, 2024
1 parent c327384 commit a190a6d
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 43 deletions.
12 changes: 6 additions & 6 deletions genshi/filters/tests/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down
4 changes: 2 additions & 2 deletions genshi/filters/tests/test_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion genshi/filters/tests/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}))
Expand Down
2 changes: 1 addition & 1 deletion genshi/template/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down
20 changes: 10 additions & 10 deletions genshi/template/tests/directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down
4 changes: 2 additions & 2 deletions genshi/template/tests/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down
2 changes: 1 addition & 1 deletion genshi/template/tests/interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down
2 changes: 1 addition & 1 deletion genshi/template/tests/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down
2 changes: 1 addition & 1 deletion genshi/template/tests/markup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down
4 changes: 2 additions & 2 deletions genshi/template/tests/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down
4 changes: 2 additions & 2 deletions genshi/template/tests/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down
2 changes: 1 addition & 1 deletion genshi/tests/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
10 changes: 5 additions & 5 deletions genshi/tests/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions genshi/tests/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down
8 changes: 4 additions & 4 deletions genshi/tests/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion genshi/tests/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion genshi/tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down

0 comments on commit a190a6d

Please sign in to comment.