Skip to content

Commit 9e8ccd7

Browse files
authored
TST: Don't use deprecated version of read_html (#33482)
1 parent b3580c1 commit 9e8ccd7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pandas/tests/io/test_html.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def test_invalid_table_attrs(self):
321321
url = self.banklist_data
322322
with pytest.raises(ValueError, match="No tables found"):
323323
self.read_html(
324-
url, "First Federal Bank of Florida", attrs={"id": "tasdfable"}
324+
url, match="First Federal Bank of Florida", attrs={"id": "tasdfable"}
325325
)
326326

327327
def _bank_data(self, *args, **kwargs):
@@ -573,7 +573,9 @@ def try_remove_ws(x):
573573
except AttributeError:
574574
return x
575575

576-
df = self.read_html(self.banklist_data, "Metcalf", attrs={"id": "table"})[0]
576+
df = self.read_html(self.banklist_data, match="Metcalf", attrs={"id": "table"})[
577+
0
578+
]
577579
ground_truth = read_csv(
578580
datapath("io", "data", "csv", "banklist.csv"),
579581
converters={"Updated Date": Timestamp, "Closing Date": Timestamp},
@@ -883,7 +885,7 @@ def test_wikipedia_states_table(self, datapath):
883885

884886
def test_wikipedia_states_multiindex(self, datapath):
885887
data = datapath("io", "data", "html", "wikipedia_states.html")
886-
result = self.read_html(data, "Arizona", index_col=0)[0]
888+
result = self.read_html(data, match="Arizona", index_col=0)[0]
887889
assert result.shape == (60, 11)
888890
assert "Unnamed" in result.columns[-1][1]
889891
assert result.columns.nlevels == 2

0 commit comments

Comments
 (0)