sphinx/tests
James Addison 267fe9afa8
Tests: explicitly unset SOURCE_DATE_EPOCH during 'test_html_multi_line_copyright' (#13224)
Sphinx's copyright substitution currently allows years identified as
the current year to be downgraded to previous years when
``SOURCE_DATE_EPOCH`` is configured, to assist reproducibility [1] of
documentation builds.

However, we have a test case ``test_html_multi_line_copyright``,
written in 2024, that mentioned a future year (2025).

Now that we have reached 2025, it is eligible for substitution when
``SOURCE_DATE_EPOCH`` is configured.  Many buildsystems, such as those
used by Debian and Fedora, choose the most-recent packaging/commit
timestamp to use as `SOURCE_DATE_EPOCH`'s timestamp, since those
correspond sensibly to a time-of-build.

However, for the Sphinx 8.1.3 release including the updated
substitution logic, the year-of-release/commit was 2024. Thus, if a
commit/packaging date from that year is chosen, and
``SOURCE_DATE_EPOCH`` is configured when the unit tests run, the
``test_html_multi_line_copyright`` test will fail.

The fix suggested here is to explicitly unset ``SOURCE_DATE_EPOCH``
within ``test_html_multi_line_copyright``.

[1]: https://www.reproducible-builds.org/

Authored-by: Colin Watson <cjwatson@debian.org>
Co-authored-by: Colin Watson <cjwatson@debian.org>
Authored-by: James Addison <55152140+jayaddison@users.noreply.github.com>
Co-authored-by: James Addison <55152140+jayaddison@users.noreply.github.com>
2025-01-10 11:21:11 +00:00
..
certs linkcheck: Specify subjectAltName in test self-signed certificate 2020-11-15 18:25:39 +01:00
js Run Ruff on `tests/js/roots/` 2025-01-02 23:53:59 +00:00
roots apidoc: Rename test roots 2025-01-07 11:06:29 +00:00
test_builders Tests: explicitly unset SOURCE_DATE_EPOCH during 'test_html_multi_line_copyright' (#13224) 2025-01-10 11:21:11 +00:00
test_config Require the PEP 563 'annotations' future import 2024-11-22 21:54:26 +00:00
test_directives Adapt tests for Pygments 2.19 2025-01-06 06:56:10 +00:00
test_domains Avoid using camelCase names 2025-01-07 00:17:00 +00:00
test_environment Avoid attribute indirection with `env` (#13212) 2025-01-05 09:10:55 +00:00
test_extensions apidoc: Rename test roots 2025-01-07 11:06:29 +00:00
test_intl Adapt tests for Pygments 2.19 2025-01-06 06:56:10 +00:00
test_markup Avoid attribute indirection with `env` (#13212) 2025-01-05 09:10:55 +00:00
test_pycode Enable the RUF031 lint in Ruff 2024-11-30 19:22:30 +00:00
test_theming Require the PEP 563 'annotations' future import 2024-11-22 21:54:26 +00:00
test_transforms Trim leading whitespace before doctest flags (#13164) 2025-01-04 00:30:03 +00:00
test_util Add `InventoryFile.loads()` (#13215) 2025-01-07 00:40:57 +00:00
test_writers Require the PEP 563 'annotations' future import 2024-11-22 21:54:26 +00:00
__init__.py Make tests/ a Python package 2020-11-20 19:43:02 +01:00
conftest.py Consistently calculate the current file's directory 2024-11-03 17:28:02 +00:00
test_addnodes.py Bump Ruff to 0.5.1 (#12530) 2024-07-10 14:13:10 +01:00
test_application.py Remove unused monkeypatch fixtures (#12841) 2024-08-31 07:48:08 +01:00
test_command_line.py Use pathlib in the tests (#13051) 2024-10-25 22:41:08 +01:00
test_errors.py Require the PEP 563 'annotations' future import 2024-11-22 21:54:26 +00:00
test_events.py Require the PEP 563 'annotations' future import 2024-11-22 21:54:26 +00:00
test_highlighting.py Adapt tests for Pygments 2.19 2025-01-06 06:56:10 +00:00
test_project.py Require the PEP 563 'annotations' future import 2024-11-22 21:54:26 +00:00
test_quickstart.py Require the PEP 563 'annotations' future import 2024-11-22 21:54:26 +00:00
test_roles.py Require the PEP 563 'annotations' future import 2024-11-22 21:54:26 +00:00
test_search.py Bump Ruff to 0.7.2 2024-11-03 02:55:19 +00:00
test_versioning.py Require the PEP 563 'annotations' future import 2024-11-22 21:54:26 +00:00
utils.py Consistently calculate the current file's directory 2024-11-03 17:28:02 +00:00