diff --git a/tests/test_build_html.py b/tests/test_build_html.py
index 48fef24c8..c53d0b97d 100644
--- a/tests/test_build_html.py
+++ b/tests/test_build_html.py
@@ -1554,7 +1554,7 @@ def test_validate_html_static_path(app):
@pytest.mark.sphinx(testroot='html_scaled_image_link')
def test_html_scaled_image_link(app):
app.build()
- context = (app.outdir / 'index.html').text()
+ context = (app.outdir / 'index.html').read_text()
# no scaled parameters
assert re.search('\n
', context)