Use Node.findall

This commit is contained in:
Adam Turner
2022-04-22 03:34:31 +01:00
parent cbe0c99181
commit 35ed39c946
3 changed files with 4 additions and 4 deletions

View File

@@ -591,7 +591,7 @@ def test_linenothreshold(app, status, warning):
def test_code_block_dedent(app, status, warning):
app.builder.build(['dedent'])
doctree = app.env.get_doctree('dedent')
codeblocks = list(doctree.traverse(nodes.literal_block))
codeblocks = [*doctree.findall(nodes.literal_block)]
# Note: comparison string should not have newlines at the beginning or end
text_0_indent = '''First line
Second line