diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/account_test.py | 4 | ||||
-rw-r--r-- | tests/commands/global_test.py | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/tests/account_test.py b/tests/account_test.py index c1fca557..9f6287be 100644 --- a/tests/account_test.py +++ b/tests/account_test.py @@ -15,6 +15,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. +import logging import unittest from alot import account @@ -172,4 +173,5 @@ class TestSend(unittest.TestCase): async def test_failing_sendmail_command_is_noticed(self): a = account.SendmailAccount(address="test@alot.dev", cmd="false") with self.assertRaises(account.SendingMailFailed): - await a.send_mail("some text") + with self.assertLogs(level=logging.ERROR): + await a.send_mail("some text") diff --git a/tests/commands/global_test.py b/tests/commands/global_test.py index 48ddd34d..e5503305 100644 --- a/tests/commands/global_test.py +++ b/tests/commands/global_test.py @@ -16,6 +16,7 @@ """Tests for global commands.""" +import logging import os import tempfile import unittest @@ -112,10 +113,11 @@ class TestComposeCommand(unittest.TestCase): mock.Mock(return_value=[account])): with mock.patch('alot.commands.globals.settings.get_addressbooks', mock.Mock(side_effect=Stop)): - try: - await cmd.apply(mock.Mock()) - except Stop: - pass + with self.assertLogs(level=logging.WARNING): + try: + await cmd.apply(mock.Mock()) + except Stop: + pass self.assertFalse(envelope.sign) self.assertIs(envelope.sign_key, None) |