diff options
| author | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-03-05 17:11:05 +0000 |
|---|---|---|
| committer | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-03-05 17:11:05 +0000 |
| commit | dabba59fc729397d4d7dbf4e30edfd9bc76899a9 (patch) | |
| tree | 6f70ae9865a16015e17715f714f95fe81511df4b /docutils | |
| parent | 733521666bd4ce32cacfcb0e01c8ab358278e623 (diff) | |
| download | docutils-dabba59fc729397d4d7dbf4e30edfd9bc76899a9.tar.gz | |
reverted test_nodes.py from 1.14 to 1.13; the nested scopes are
necessary because of the lambda expression in line 146::
self.assertEquals(getlist(e, cond=lambda x: x not in e[0:2]),
[e[0][0], e[0][1], e[0][1][0], e[2]])
otherwise it doesn't work with Python 2.1 because we can't reference
the local e variable.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@3010 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils')
| -rwxr-xr-x | docutils/test/test_nodes.py | 16 | ||||
| -rwxr-xr-x | docutils/test/test_transforms/test_contents.py | 8 |
2 files changed, 12 insertions, 12 deletions
diff --git a/docutils/test/test_nodes.py b/docutils/test/test_nodes.py index 25bcd3d7a..fee03ffe2 100755 --- a/docutils/test/test_nodes.py +++ b/docutils/test/test_nodes.py @@ -10,6 +10,8 @@ Test module for nodes.py. """ +from __future__ import nested_scopes + import unittest from types import ClassType from DocutilsTestSupport import nodes, utils @@ -117,15 +119,13 @@ class MiscTests(unittest.TestCase): self.assert_(e.has_children()) self.assert_(not e[0].has_children()) - def getlist(self, n, **kwargs): - r = [] - while n is not None: - n = n.next_node(**kwargs) - r.append(n) - return r[:-1] - def test_next_node(self): - getlist = self.getlist + def getlist(n, **kwargs): + r = [] + while n is not None: + n = n.next_node(**kwargs) + r.append(n) + return r[:-1] e = nodes.Element() e += nodes.Element() e[0] += nodes.Element() diff --git a/docutils/test/test_transforms/test_contents.py b/docutils/test/test_transforms/test_contents.py index 6816ba2eb..3fbc04a9d 100755 --- a/docutils/test/test_transforms/test_contents.py +++ b/docutils/test/test_transforms/test_contents.py @@ -32,12 +32,12 @@ Title 1 ======= Paragraph 1. -Title 2 -------- +Title_ 2 +-------- Paragraph 2. -Title 3 -``````` +_`Title` 3 +`````````` Paragraph 3. Title 4 |
