[tests] use deduced `srcdir` instead of an explicit one (#12124)

This commit is contained in:
Bénédikt Tran 2024-03-18 10:59:48 +01:00 committed by GitHub
parent bf0bec3b4b
commit 6ac2210109
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1635,13 +1635,13 @@ def test_gettext_disallow_fuzzy_translations(app):
@pytest.mark.sphinx('html', testroot='basic', confoverrides={'language': 'de'})
def test_customize_system_message(make_app, app_params, sphinx_test_tempdir):
def test_customize_system_message(make_app, app_params):
try:
# clear translators cache
locale.translators.clear()
# prepare message catalog (.po)
locale_dir = sphinx_test_tempdir / 'basic' / 'locales' / 'de' / 'LC_MESSAGES'
locale_dir = app_params.kwargs['srcdir'] / 'locales' / 'de' / 'LC_MESSAGES'
locale_dir.mkdir(parents=True, exist_ok=True)
with (locale_dir / 'sphinx.po').open('wb') as f:
catalog = Catalog()