From 1bdbeadedc91c7a3ad2dc8c2fbe2e16623703a01 Mon Sep 17 00:00:00 2001 From: M Bussonnier Date: Wed, 10 Jul 2024 10:32:40 +0200 Subject: [PATCH] fix tests --- tests/test_build.py | 8 ++++---- tests/test_build/sidebar_subpage.html | 11 +++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/test_build.py b/tests/test_build.py index 0174f229f..e7bb73c78 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -184,7 +184,7 @@ def test_primary_logo_is_light_when_no_default_mode(sphinx_build_factory) -> Non index_html = sphinx_build.html_tree("index.html") navbar_brand = index_html.select(".navbar-brand")[0] assert navbar_brand.find("img", class_="only-light") is not None - assert navbar_brand.find("script", string=re.compile("only-dark")) is not None + assert navbar_brand.find("img", class_="only-dark") is not None def test_primary_logo_is_light_when_default_mode_is_set_to_auto( @@ -199,7 +199,7 @@ def test_primary_logo_is_light_when_default_mode_is_set_to_auto( index_html = sphinx_build.html_tree("index.html") navbar_brand = index_html.select(".navbar-brand")[0] assert navbar_brand.find("img", class_="only-light") is not None - assert navbar_brand.find("script", string=re.compile("only-dark")) is not None + assert navbar_brand.find("img", class_="only-dark") is not None def test_primary_logo_is_light_when_default_mode_is_light(sphinx_build_factory) -> None: @@ -212,7 +212,7 @@ def test_primary_logo_is_light_when_default_mode_is_light(sphinx_build_factory) index_html = sphinx_build.html_tree("index.html") navbar_brand = index_html.select(".navbar-brand")[0] assert navbar_brand.find("img", class_="only-light") is not None - assert navbar_brand.find("script", string=re.compile("only-dark")) is not None + assert navbar_brand.find("img", class_="only-dark") is not None def test_primary_logo_is_dark_when_default_mode_is_dark(sphinx_build_factory) -> None: @@ -225,7 +225,7 @@ def test_primary_logo_is_dark_when_default_mode_is_dark(sphinx_build_factory) -> index_html = sphinx_build.html_tree("index.html") navbar_brand = index_html.select(".navbar-brand")[0] assert navbar_brand.find("img", class_="only-dark") is not None - assert navbar_brand.find("script", string=re.compile("only-light")) is not None + assert navbar_brand.find("img", class_="only-light") is not None def test_logo_missing_image(sphinx_build_factory) -> None: diff --git a/tests/test_build/sidebar_subpage.html b/tests/test_build/sidebar_subpage.html index 235236f9c..2eb1b57d1 100644 --- a/tests/test_build/sidebar_subpage.html +++ b/tests/test_build/sidebar_subpage.html @@ -33,10 +33,13 @@