test doit: need to also mock sys.argv :/ :/ :/ :/

This commit is contained in:
codl 2018-08-13 18:03:58 +02:00
parent 8f013a7bc7
commit 7238082f23
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
1 changed files with 4 additions and 3 deletions

View File

@ -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)