feat: catch patch.object on a command

This commit is contained in:
Abdessamad Derraz committed 2026-11-21 15:48:32 +01:00
1 parent e0f4d7eba5
commit c3054bef4c
5 files changed
+13 -7

No files matched your search

+1 -1
View File
@@ -131,7 +131,7 @@ class TestCommandLine(unittest.TestCase):
with mock.patch.object(sys, "argv", ["fileless.py", *argv,
"--emulators-dir", self.tmp.name]), \
mock.patch.object(fileless_audit, "audit", side_effect=fake), \
mock.patch.object(fileless, "audit", side_effect=fake), \
mock.patch("sys.stderr"), mock.patch("sys.stdout"), self.assertRaises(SystemExit) as caught:
fileless_audit.main()
return caught.exception.code, read