diff --git a/mwparserfromhell/smart_list.py b/mwparserfromhell/smart_list.py index 67d96be..7c29c60 100644 --- a/mwparserfromhell/smart_list.py +++ b/mwparserfromhell/smart_list.py @@ -363,4 +363,4 @@ class _ListProxy(list): self._parent[self._start:self._stop:self._step] = item -del inheritdoc \ No newline at end of file +del inheritdoc diff --git a/tests/test_smart_list.py b/tests/test_smart_list.py index e22ad27..b83f4d3 100644 --- a/tests/test_smart_list.py +++ b/tests/test_smart_list.py @@ -38,5 +38,15 @@ class TestSmartList(unittest.TestCase): self.assertEquals(expected, smartlist_doc) self.assertEquals(expected, listproxy_doc) + def test_doctest(self): + """make sure a test embedded in SmartList's docstring passes""" + parent = SmartList([0, 1, 2, 3]) + self.assertEquals([0, 1, 2, 3], parent) + child = parent[2:] + self.assertEquals([2, 3], child) + child.append(4) + self.assertEquals([2, 3, 4], child) + self.assertEquals([0, 1, 2, 3, 4], parent) + if __name__ == "__main__": unittest.main(verbosity=2)