From f626983fdb4685c47a931c08a6a1b29188ad3835 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Wed, 5 Nov 2025 09:49:10 -0800 Subject: [PATCH] Fix BeautifulSoup deprecation warnings in tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes findNext → find_next and nextSibling → next_sibling Refs 9becb04e --- tests/test_html.py | 2 +- tests/test_table_html.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_html.py b/tests/test_html.py index 1489e56d..cea91d2e 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -333,7 +333,7 @@ def test_row_links_from_other_tables(app_client, path, expected_text, expected_l soup = Soup(response.body, "html.parser") h2 = soup.find("h2") assert h2.text == "Links from other tables" - li = h2.findNext("ul").find("li") + li = h2.find_next("ul").find("li") text = re.sub(r"\s+", " ", li.text.strip()) assert text == expected_text link = li.find("a")["href"] diff --git a/tests/test_table_html.py b/tests/test_table_html.py index fee0b702..3cbbe27d 100644 --- a/tests/test_table_html.py +++ b/tests/test_table_html.py @@ -1032,7 +1032,7 @@ def test_column_metadata(app_client): response = app_client.get("/fixtures/roadside_attractions") soup = Soup(response.body, "html.parser") dl = soup.find("dl") - assert [(dt.text, dt.nextSibling.text) for dt in dl.find_all("dt")] == [ + assert [(dt.text, dt.next_sibling.text) for dt in dl.find_all("dt")] == [ ("name", "The name of the attraction"), ("address", "The street address for the attraction"), ]