Created
October 26, 2018 14:10
-
-
Save johnmanjiro13/b6b8b6e09c24c1a313e6a18883759494 to your computer and use it in GitHub Desktop.
mock_func for test decorator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unittest.mock import MagicMock | |
mock_func = MagicMock() | |
mock_func.return_value = "mock return !" # 戻り値の設定 | |
mock_func.side_effect = Exception() # 例外の設定 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment