Skip to content

Commit cf768c8

Browse files
authored
Fix test_rtd_valid (#138)
1 parent 0cd67f5 commit cf768c8

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

sphinxext/opengraph/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,7 @@ def get_tags(
250250

251251

252252
def ambient_site_url() -> str:
253-
# readthedocs addons sets the READTHEDOCS_CANONICAL_URL variable,
254-
# or defines the ``html_baseurl`` variable in conf.py
253+
# readthedocs addons sets the READTHEDOCS_CANONICAL_URL variable
255254
if rtd_canonical_url := os.getenv('READTHEDOCS_CANONICAL_URL'):
256255
parse_result = urlsplit(rtd_canonical_url)
257256
else:

tests/test_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def test_rtd_override(app: Sphinx, monkeypatch):
305305
@pytest.mark.sphinx('html', testroot='rtd-default')
306306
def test_rtd_valid(app: Sphinx, monkeypatch):
307307
monkeypatch.setenv('READTHEDOCS', 'True')
308-
app.config.html_baseurl = 'https://failure.com/en/latest/'
308+
monkeypatch.setenv('READTHEDOCS_CANONICAL_URL', 'https://failure.com/en/latest/')
309309

310310
app.build()
311311
tags = conftest._og_meta_tags(app)

0 commit comments

Comments
 (0)