Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b66df71 commit 9812eb9Copy full SHA for 9812eb9
stock_alerter/tests/test_action.py
@@ -6,11 +6,7 @@
6
7
class PrintActionTest(unittest.TestCase):
8
def test_executing_action_prints_message(self):
9
- patcher = mock.patch('builtins.print')
10
- mock_print = patcher.start()
11
- try:
+ with mock.patch('builtins.print') as mock_print:
12
action = PrintAction()
13
action.execute("GOOG > $10")
14
mock_print.assert_called_with("GOOG > $10")
15
- finally:
16
- patcher.stop()
0 commit comments