fix: keep tests and doc generators away from the developer's config files

test_docsphinx pointed EOS_DIR/EOS_CONFIG_DIR at an empty temporary
directory. EOS then fell back to the config file in the user config
directory, migrated it and wrote it back with a timestamped backup. The
test now writes an empty config file into the temporary directory, as
server_base does.

Additional fixes
- Decode the Sphinx output in test_sphinx_build as UTF-8; on Windows the
  default code page failed and the test reported a NoneType error.
- Check the user config directory with the app author in
  --check-config-side-effect, as EOS does; on Windows the check looked at
  the wrong directory.
- Let the doc generators create EOS' config file in a temporary directory.
  They left an EOS.config.json in the working directory, and a following
  make test-ci then failed in every test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Bobby Noelte
2026-11-09 13:40:25 +01:00
committed by GitHub
co-authored by Claude Opus 5.5
parent d68f040206
commit c230d9d9de
5 changed files with 30 additions and 5 deletions
+7 -1
View File
@@ -6,6 +6,7 @@ import json
import os
import re
import sys
import tempfile
import textwrap
from pathlib import Path
from typing import Any, Optional, Type, TypeVar, Union, get_args
@@ -524,4 +525,9 @@ def main():
ConfigEOS._force_documentation_mode = False
if __name__ == "__main__":
main()
# EOS creates a config file if it finds none. Let it do so in a temporary
# directory, not in the working directory (e.g. the repository root).
with tempfile.TemporaryDirectory(prefix="eos-docs-") as eos_dir:
os.environ["EOS_DIR"] = eos_dir
os.environ["EOS_CONFIG_DIR"] = eos_dir
main()