mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-28 04:18:52 -06:00
fix: let make_site_icons answer --help
This commit is contained in:
1 parent
f158f1d485
commit
61547d08b3
2 files changed
+20
No files matched your search
@@ -1012,5 +1012,21 @@ class CitedCommandsRunWhenPasted(unittest.TestCase):
|
||||
str(caught.exception))
|
||||
|
||||
|
||||
class EveryCommandReadsItsArguments(unittest.TestCase):
|
||||
"""make_site_icons.py parsed no argument: `--help` launched Chromium and
|
||||
rewrote nine committed images. A command answers its arguments or refuses
|
||||
them, never runs past them."""
|
||||
|
||||
READERS = ("ArgumentParser", "sys.argv", "scraper_cli(", "target_cli(")
|
||||
|
||||
def test_each_entry_point_reads_argv(self):
|
||||
found = [
|
||||
path.name for path in sorted((REPO_ROOT / "scripts").glob("*.py"))
|
||||
if 'if __name__ == "__main__"' in (text := path.read_text(encoding="utf-8"))
|
||||
and not any(reader in text for reader in self.READERS)
|
||||
]
|
||||
self.assertEqual(found, [])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user