Skip to content

Commit

Permalink
Merge pull request #1050 from sphinx-contrib/move-linkcode-ext-regist…
Browse files Browse the repository at this point in the history
…ration-in-validation

tests: moving the linkcode extension registration in validation
  • Loading branch information
jdknight authored Oct 12, 2024
2 parents 3c7dcfb + d8fe26f commit 172f73b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def setUpClass(cls):
space_key = os.getenv(SPACE_ENV_KEY, DEFAULT_TEST_SPACE)
cls.config = prepare_conf()
cls.config['extensions'].append('sphinx.ext.ifconfig')
cls.config['extensions'].append('sphinx.ext.linkcode')
cls.config['confluence_api_token'] = os.getenv(AUTH_ENV_KEY)
cls.config['confluence_full_width'] = False
cls.config['confluence_page_generation_notice'] = True
Expand All @@ -60,16 +59,6 @@ def setUpClass(cls):
cls.test_key = os.getenv(TESTKEY_ENV_KEY, DEFAULT_TEST_KEY)
cls.test_version = os.getenv(TESTKEY_ENV_VERSION, DEFAULT_TEST_VERSION)

def linkcode_resolve(domain, info):
module = info.get('module', None)
if module != 'linkcode_example':
return None
name = info.get('fullname', None)
if not name:
return None
return f'https://example.org/src/{name}'
cls.config['linkcode_resolve'] = linkcode_resolve

# overrides from user
try:
from validation_test_overrides import config_overrides
Expand Down Expand Up @@ -308,10 +297,21 @@ def _test_extensions(self, editor):
config['extensions'].append('sphinx.ext.graphviz')
config['extensions'].append('sphinx.ext.ifconfig')
config['extensions'].append('sphinx.ext.inheritance_diagram')
config['extensions'].append('sphinx.ext.linkcode')
config['extensions'].append('sphinx.ext.todo')
config['todo_include_todos'] = True
config['todo_link_only'] = True

def linkcode_resolve(domain, info):
module = info.get('module', None)
if module != 'linkcode_example':
return None
name = info.get('fullname', None)
if not name:
return None
return f'https://example.org/src/{name}'
config['linkcode_resolve'] = linkcode_resolve

# always force png since svgs do not look nice in v2
if editor == 'v2':
config['imgmath_image_format'] = 'png'
Expand Down

0 comments on commit 172f73b

Please sign in to comment.