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, 4 insertions, 8 deletions
diff --git a/tests/commands/envelope_test.py b/tests/commands/envelope_test.py
index 30e21c03..ee1c0acc 100644
--- a/tests/commands/envelope_test.py
+++ b/tests/commands/envelope_test.py
@@ -230,10 +230,8 @@ class TestSignCommand(unittest.TestCase):
"""
env, ui = self._make_ui_mock()
- func_patcher = mock.patch(
- 'alot.commands.envelope.settings.get_account_by_address',
- mock.Mock(return_value=mock.Mock(gpg_key=None)))
- with func_patcher:
+ with mock.patch('alot.commands.envelope.settings.get_account_by_address',
+ mock.Mock(return_value=mock.Mock(gpg_key=None))):
cmd = envelope.SignCommand(action='sign', keyid=None)
cmd.apply(ui)
@@ -247,10 +245,8 @@ class TestSignCommand(unittest.TestCase):
"""
env, ui = self._make_ui_mock()
- func_patcher = mock.patch(
- 'alot.commands.envelope.settings.get_account_by_address',
- mock.Mock(return_value=mock.Mock(gpg_key='sentinel')))
- with func_patcher:
+ with mock.patch('alot.commands.envelope.settings.get_account_by_address',
+ mock.Mock(return_value=mock.Mock(gpg_key='sentinel'))):
cmd = envelope.SignCommand(action='sign', keyid=None)
cmd.apply(ui)