From 0b772fe255246951a62550ef69d7dbaed7dba2bc Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Wed, 21 Oct 2026 10:01:07 +0200 Subject: [PATCH] docs: compare scraper output in the repo tmp/ --- tests/test_doc_pages.py | 27 +++++++++++++++++++++++++++ wiki/adding-a-scraper.md | 9 ++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/tests/test_doc_pages.py b/tests/test_doc_pages.py index 86e44d4d..cf689167 100644 --- a/tests/test_doc_pages.py +++ b/tests/test_doc_pages.py @@ -600,5 +600,32 @@ class CiTriggersPointToTheirLists(unittest.TestCase): self.assertIn(f"`{named.rstrip('*')}`", section) +class ScratchFilesGoToRepoTmp(unittest.TestCase): + """adding-a-scraper.md wrote its comparison to /tmp while two other + pages say /tmp is a RAM disk and send scratch files to the repo's tmp/.""" + + @staticmethod + def _code_lines(text: str) -> list[str]: + lines, inside = [], False + for line in text.splitlines(): + if line.strip().startswith("```"): + inside = not inside + elif inside: + lines.append(line) + return lines + + def test_no_command_writes_to_slash_tmp(self): + offenders = [ + f"{page.name}: {line.strip()}" + for page in PUBLISHED + for line in self._code_lines(page.read_text(encoding="utf-8")) + if re.search(r"(?