summaryrefslogtreecommitdiff
path: root/tests/commands/envelope_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/commands/envelope_test.py')
-rw-r--r--tests/commands/envelope_test.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/commands/envelope_test.py b/tests/commands/envelope_test.py
index ee1c0acc..30e21c03 100644
--- a/tests/commands/envelope_test.py
+++ b/tests/commands/envelope_test.py
@@ -230,8 +230,10 @@ class TestSignCommand(unittest.TestCase):
"""
env, ui = self._make_ui_mock()
- with mock.patch('alot.commands.envelope.settings.get_account_by_address',
- mock.Mock(return_value=mock.Mock(gpg_key=None))):
+ func_patcher = mock.patch(
+ 'alot.commands.envelope.settings.get_account_by_address',
+ mock.Mock(return_value=mock.Mock(gpg_key=None)))
+ with func_patcher:
cmd = envelope.SignCommand(action='sign', keyid=None)
cmd.apply(ui)
@@ -245,8 +247,10 @@ class TestSignCommand(unittest.TestCase):
"""
env, ui = self._make_ui_mock()
- with mock.patch('alot.commands.envelope.settings.get_account_by_address',
- mock.Mock(return_value=mock.Mock(gpg_key='sentinel'))):
+ func_patcher = mock.patch(
+ 'alot.commands.envelope.settings.get_account_by_address',
+ mock.Mock(return_value=mock.Mock(gpg_key='sentinel')))
+ with func_patcher:
cmd = envelope.SignCommand(action='sign', keyid=None)
cmd.apply(ui)