Skip to content

Commit 817a304

Browse files
committed
Uncap beautifulsoup on most versions
1 parent 600695e commit 817a304

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

tests/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
beautifulsoup4<4.12.1,>=4.9.1
1+
#beautifulsoup4<4.12.1,>=4.9.1
22
coincidence>=0.2.0
33
coverage>=5.1
44
coverage-pyver-pragma>=0.2.1

tests/test_autoenum.py

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def preprocess_soup(soup: BeautifulSoup) -> None:
8787
for dt in soup.select("span.sig-return"):
8888
dt.replace_with(NavigableString(dt.get_text()))
8989

90-
for div in soup.findAll("script"):
90+
for div in soup.find_all("script"):
9191
if div.get("src"):
9292
div["src"] = div["src"].split("?v=")[0]
9393
print(div["src"])
@@ -120,24 +120,25 @@ def test_index(page: BeautifulSoup, html_regression: HTMLRegressionFixture):
120120

121121
class_count = 0
122122

123-
for class_ in page.findAll("dl"):
123+
for class_ in page.find_all("dl"):
124124
if "enum" not in class_["class"]:
125125
continue
126126

127127
if class_count == 0:
128128
assert class_.find("dt")["id"] == "enum_tools.demo.People"
129-
assert class_.find("dd").findAll('p')[0].contents[0] == "An enumeration of people."
129+
assert class_.find("dd").find_all('p')[0].contents[0] == "An enumeration of people."
130130
elif class_count == 1:
131131
assert class_.find("dt")["id"] == "enum_tools.demo.NoMethods"
132-
assert class_.find("dd").findAll('p')[0].contents[0] == "An enumeration of people without any methods."
132+
assert class_.find("dd").find_all('p'
133+
)[0].contents[0] == "An enumeration of people without any methods."
133134

134135
tag = '<code class="xref py py-class docutils literal notranslate">int</code>'
135-
assert str(class_.find("dd").findAll('p')[1].contents[0]) == tag
136-
assert class_.find("dd").findAll('p')[2].contents[0] == "Valid values are as follows:"
136+
assert str(class_.find("dd").find_all('p')[1].contents[0]) == tag
137+
assert class_.find("dd").find_all('p')[2].contents[0] == "Valid values are as follows:"
137138

138139
attr_count = 0
139140

140-
for attr in class_.findAll("dl"):
141+
for attr in class_.find_all("dl"):
141142
if "attribute" not in attr["class"]:
142143
continue
143144

@@ -219,7 +220,7 @@ def test_flag(page: BeautifulSoup, html_regression: HTMLRegressionFixture):
219220

220221
class_count = 0
221222

222-
for class_ in page.findAll("dl"):
223+
for class_ in page.find_all("dl"):
223224
if "flag" not in class_["class"]:
224225
continue
225226

@@ -228,15 +229,15 @@ def test_flag(page: BeautifulSoup, html_regression: HTMLRegressionFixture):
228229
elif class_count == 1:
229230
assert class_.find("dt")["id"] == "id0"
230231

231-
assert class_.find("dd").findAll('p')[0].contents[0] == "An enumeration of status codes."
232+
assert class_.find("dd").find_all('p')[0].contents[0] == "An enumeration of status codes."
232233

233234
tag = '<code class="xref py py-class docutils literal notranslate">int</code>'
234-
assert str(class_.find("dd").findAll('p')[1].contents[0]) == tag
235-
assert class_.find("dd").findAll('p')[2].contents[0] == "Valid values are as follows:"
235+
assert str(class_.find("dd").find_all('p')[1].contents[0]) == tag
236+
assert class_.find("dd").find_all('p')[2].contents[0] == "Valid values are as follows:"
236237

237238
attr_count = 0
238239

239-
for attr in class_.findAll("dl"):
240+
for attr in class_.find_all("dl"):
240241
if "attribute" not in attr["class"]:
241242
continue
242243

@@ -305,24 +306,24 @@ def test_no_member_doc(page: BeautifulSoup, html_regression: HTMLRegressionFixtu
305306

306307
class_count = 0
307308

308-
for class_ in page.findAll("dl"):
309+
for class_ in page.find_all("dl"):
309310
if "enum" not in class_["class"]:
310311
continue
311312

312313
assert class_.find("dt")["id"] == "enum_tools.demo.NoMemberDoc"
313-
assert class_.find("dd").findAll('p')[0].contents[
314+
assert class_.find("dd").find_all('p')[0].contents[
314315
0] == "An enumeration of people without any member docstrings."
315316

316317
if class_count == 0:
317318
tag = '<code class="xref py py-class docutils literal notranslate">int</code>'
318-
assert str(class_.find("dd").findAll('p')[1].contents[0]) == tag
319-
assert class_.find("dd").findAll('p')[2].contents[0] == "Valid values are as follows:"
319+
assert str(class_.find("dd").find_all('p')[1].contents[0]) == tag
320+
assert class_.find("dd").find_all('p')[2].contents[0] == "Valid values are as follows:"
320321
else:
321-
assert class_.find("dd").findAll('p')[1].contents[0] == "Valid values are as follows:"
322+
assert class_.find("dd").find_all('p')[1].contents[0] == "Valid values are as follows:"
322323

323324
attr_count = 0
324325

325-
for attr in class_.findAll("dl"):
326+
for attr in class_.find_all("dl"):
326327
if "attribute" not in attr["class"]:
327328
continue
328329

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ deps =
9494
sphinxcontrib-qthelp<=1.0.3
9595
sphinxcontrib-serializinghtml<=1.1.5
9696
alabaster<=0.7.13
97+
sphinx{3.5,4.0}: beautifulsoup4==4.12.0
9798
extras = all
9899
commands =
99100
python --version

0 commit comments

Comments
 (0)