diff --git a/mwparserfromhell/nodes/argument.py b/mwparserfromhell/nodes/argument.py index 06facb4..d7db92a 100644 --- a/mwparserfromhell/nodes/argument.py +++ b/mwparserfromhell/nodes/argument.py @@ -30,6 +30,7 @@ __all__ = ["Argument"] class Argument(Node): """Represents a template argument substitution, like ``{{{foo}}}``.""" + def __init__(self, name, default=None): super(Argument, self).__init__() self._name = name diff --git a/mwparserfromhell/nodes/comment.py b/mwparserfromhell/nodes/comment.py index b34c29e..e96ce38 100644 --- a/mwparserfromhell/nodes/comment.py +++ b/mwparserfromhell/nodes/comment.py @@ -29,6 +29,7 @@ __all__ = ["Comment"] class Comment(Node): """Represents a hidden HTML comment, like ````.""" + def __init__(self, contents): super(Comment, self).__init__() self._contents = contents diff --git a/mwparserfromhell/nodes/text.py b/mwparserfromhell/nodes/text.py index 60ba847..6fda3da 100644 --- a/mwparserfromhell/nodes/text.py +++ b/mwparserfromhell/nodes/text.py @@ -29,6 +29,7 @@ __all__ = ["Text"] class Text(Node): """Represents ordinary, unformatted text with no special properties.""" + def __init__(self, value): super(Text, self).__init__() self._value = value diff --git a/mwparserfromhell/nodes/wikilink.py b/mwparserfromhell/nodes/wikilink.py index f880016..6fea468 100644 --- a/mwparserfromhell/nodes/wikilink.py +++ b/mwparserfromhell/nodes/wikilink.py @@ -30,6 +30,7 @@ __all__ = ["Wikilink"] class Wikilink(Node): """Represents an internal wikilink, like ``[[Foo|Bar]]``.""" + def __init__(self, title, text=None): super(Wikilink, self).__init__() self._title = title diff --git a/mwparserfromhell/string_mixin.py b/mwparserfromhell/string_mixin.py index efd28d8..eee58b9 100644 --- a/mwparserfromhell/string_mixin.py +++ b/mwparserfromhell/string_mixin.py @@ -50,6 +50,7 @@ class StringMixIn(object): :py:meth:`__unicode__` instead of the immutable ``self`` like the regular ``str`` type. """ + if py3k: def __str__(self): return self.__unicode__() diff --git a/tests/_test_tokenizer.py b/tests/_test_tokenizer.py index 4d12dc9..379b4fa 100644 --- a/tests/_test_tokenizer.py +++ b/tests/_test_tokenizer.py @@ -38,6 +38,7 @@ class TokenizerTestCase(object): TestCTokenizer. Tests are loaded dynamically from files in the 'tokenizer' directory. """ + @classmethod def _build_test_method(cls, funcname, data): """Create and return a method to be treated as a test case method. diff --git a/tests/test_ctokenizer.py b/tests/test_ctokenizer.py index 07b5290..4dbeceb 100644 --- a/tests/test_ctokenizer.py +++ b/tests/test_ctokenizer.py @@ -27,6 +27,7 @@ from _test_tokenizer import TokenizerTestCase class TestCTokenizer(TokenizerTestCase, unittest.TestCase): """Test cases for the C tokenizer.""" + @classmethod def setUpClass(cls): from mwparserfromhell.parser._tokenizer import CTokenizer diff --git a/tests/test_docs.py b/tests/test_docs.py index 8673cb9..075b0a7 100644 --- a/tests/test_docs.py +++ b/tests/test_docs.py @@ -30,6 +30,7 @@ from mwparserfromhell.compat import py3k, str, StringIO class TestDocs(unittest.TestCase): """Integration test cases for mwparserfromhell's documentation.""" + def assertPrint(self, input, output): """Assertion check that *input*, when printed, produces *output*.""" buff = StringIO() diff --git a/tests/test_pytokenizer.py b/tests/test_pytokenizer.py index a2f2482..73e6fe7 100644 --- a/tests/test_pytokenizer.py +++ b/tests/test_pytokenizer.py @@ -27,6 +27,7 @@ from _test_tokenizer import TokenizerTestCase class TestPyTokenizer(TokenizerTestCase, unittest.TestCase): """Test cases for the Python tokenizer.""" + @classmethod def setUpClass(cls): from mwparserfromhell.parser.tokenizer import Tokenizer diff --git a/tests/test_smart_list.py b/tests/test_smart_list.py index b0a10cb..f6d22ae 100644 --- a/tests/test_smart_list.py +++ b/tests/test_smart_list.py @@ -384,7 +384,5 @@ class TestSmartList(unittest.TestCase): self.assertEquals([4, 3, 2, 1.9, 1.8, 5, 6, 7, 8, 8.1, 8.2], child1) self.assertEquals([4, 3, 2, 1.9, 1.8], child2) - # also test whether children that exit scope are removed from parent's map - if __name__ == "__main__": unittest.main(verbosity=2) diff --git a/tests/test_string_mixin.py b/tests/test_string_mixin.py index 8d86c8e..7b99995 100644 --- a/tests/test_string_mixin.py +++ b/tests/test_string_mixin.py @@ -37,6 +37,7 @@ class _FakeString(StringMixIn): class TestStringMixIn(unittest.TestCase): """Test cases for the StringMixIn class.""" + def test_docs(self): """make sure the various methods of StringMixIn have docstrings""" methods = [