From 7238082f232140df6bb56d615e92d45c6e60f6e4 Mon Sep 17 00:00:00 2001 From: codl Date: Mon, 13 Aug 2018 18:03:58 +0200 Subject: [PATCH] test doit: need to also mock sys.argv :/ :/ :/ :/ --- test/test_doit.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/test_doit.py b/test/test_doit.py index 160775d..0d122fb 100644 --- a/test/test_doit.py +++ b/test/test_doit.py @@ -4,6 +4,7 @@ from unittest.mock import patch def test_doit(): - with patch('sys.exit') as exit: - doit.run(dodo) - exit.assert_called_with(0) + with patch('sys.exit') as _exit: + with patch('sys.argv') as argv: + doit.run(dodo) + _exit.assert_called_with(0)