From fa9fbbed9eeddf70668ace6d2b4f60d65ff9de1d Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Wed, 4 Nov 2026 05:51:40 +0100 Subject: [PATCH] fix: a cited module may be a package python -m runs a package by its __main__.py: scripts.scraper.romfolders is one. --- tests/test_doc_pages.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_doc_pages.py b/tests/test_doc_pages.py index 5fb8d47a1..6a99eeb86 100644 --- a/tests/test_doc_pages.py +++ b/tests/test_doc_pages.py @@ -1270,7 +1270,9 @@ class CitedScriptsExist(unittest.TestCase): found = [] for number, target, module, _args in _commands(text): path = ROOT / (target.replace(".", "/") + ".py" if module else target) - if not path.is_file(): + # `python -m` also runs a package by its __main__.py. + package = ROOT / target.replace(".", "/") / "__main__.py" if module else None + if not path.is_file() and not (package and package.is_file()): found.append(f"{number}: {target}") found += [ f"{number}: {name}"