summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAdam Turner <9087854+AA-Turner@users.noreply.github.com>2023-04-21 19:04:26 +0100
committerGitHub <noreply@github.com>2023-04-21 19:04:26 +0100
commitaee3c0ab75974790adf359a9c5089d1d781a6b21 (patch)
treef15ca9a759ca865d656e2d78ef201b3ddf3a5412 /tests
parent186d596f3323f3141c34618e2e788e5cdff8fec3 (diff)
downloadsphinx-git-aee3c0ab75974790adf359a9c5089d1d781a6b21.tar.gz
Partially revert "Disable localisation when SOURCE_DATE_EPOCH is set (#10949)" (#11343)
This keeps some of the added tests, and avoids a full revert of ``sphinx.locale``.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_locale.py22
-rw-r--r--tests/test_util_inventory.py25
2 files changed, 0 insertions, 47 deletions
diff --git a/tests/test_locale.py b/tests/test_locale.py
index 1d90473ca..11dd95db9 100644
--- a/tests/test_locale.py
+++ b/tests/test_locale.py
@@ -74,25 +74,3 @@ def test_init_environment_language(rootdir, monkeypatch):
m.setenv("LANGUAGE", "et_EE:et")
_ = _empty_language_translation(rootdir)
assert _('Hello world') == 'Tere maailm'
-
-
-def test_init_reproducible_build_language(rootdir, monkeypatch):
- with monkeypatch.context() as m:
- m.setenv("SOURCE_DATE_EPOCH", "0")
- m.setenv("LANGUAGE", "en_US:en")
- _ = _empty_language_translation(rootdir)
- sde_en_translation = str(_('Hello world')) # str cast to evaluate lazy method
-
- with monkeypatch.context() as m:
- m.setenv("SOURCE_DATE_EPOCH", "0")
- m.setenv("LANGUAGE", "et_EE:et")
- _ = _empty_language_translation(rootdir)
- sde_et_translation = str(_('Hello world')) # str cast to evaluate lazy method
-
- with monkeypatch.context() as m:
- m.setenv("LANGUAGE", "et_EE:et")
- _ = _empty_language_translation(rootdir)
- loc_et_translation = str(_('Hello world')) # str cast to evaluate lazy method
-
- assert sde_en_translation == sde_et_translation
- assert sde_et_translation != loc_et_translation
diff --git a/tests/test_util_inventory.py b/tests/test_util_inventory.py
index 675bba06b..2833d979e 100644
--- a/tests/test_util_inventory.py
+++ b/tests/test_util_inventory.py
@@ -114,28 +114,3 @@ def test_inventory_localization(tempdir):
# Ensure that the inventory contents differ
assert inventory_et.read_bytes() != inventory_en.read_bytes()
-
-
-def test_inventory_reproducible(tempdir, monkeypatch):
- with monkeypatch.context() as m:
- # Configure reproducible builds
- # See: https://reproducible-builds.org/docs/source-date-epoch/
- m.setenv("SOURCE_DATE_EPOCH", "0")
-
- # Build an app using Estonian (EE) locale
- srcdir_et = _write_appconfig(tempdir, "et")
- reproducible_inventory_et = _build_inventory(srcdir_et)
-
- # Build the same app using English (US) locale
- srcdir_en = _write_appconfig(tempdir, "en")
- reproducible_inventory_en = _build_inventory(srcdir_en)
-
- # Also build the app using Estonian (EE) locale without build reproducibility enabled
- srcdir_et = _write_appconfig(tempdir, "et", prefix="localized")
- localized_inventory_et = _build_inventory(srcdir_et)
-
- # Ensure that the reproducible inventory contents are identical
- assert reproducible_inventory_et.read_bytes() == reproducible_inventory_en.read_bytes()
-
- # Ensure that inventory contents are different between a localized and non-localized build
- assert reproducible_inventory_et.read_bytes() != localized_inventory_et.read_bytes()