Skip to content

Commit 444b5a9

Browse files
committed
Simplifies a test helper
1 parent 8da458a commit 444b5a9

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

tests/test_autodocsumm.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,7 @@ def get_soup(app, fname):
4747

4848
def in_autosummary(what, html) -> bool:
4949
soup = bs4.BeautifulSoup(html, "html.parser")
50-
autosummaries = soup("table")
51-
found = False
52-
for tag in autosummaries:
53-
if tag.find_all("span", string=what):
54-
found = True
55-
break
56-
return found
50+
return any(tag.find_all("span", string=what) for tag in soup("table"))
5751

5852

5953
class TestAutosummaryDocumenter:

0 commit comments

Comments
 (0)