summaryrefslogtreecommitdiff
path: root/tests/commands
diff options
context:
space:
mode:
authorLucas Hoffmann <lucc@posteo.de>2018-10-11 12:47:18 +0200
committerPatrick Totzke <patricktotzke@gmail.com>2018-11-11 13:50:11 +0000
commit5d01c19644913088d11a6f350e0935de1c7fa84d (patch)
tree15530443aaeb8a2940a696a56bc71da2f949f192 /tests/commands
parent7fd1bfc05748057081fcc63f3ae4bb2746b1e8ed (diff)
Assert some logging messages to silence them
The logging messages appear in between the test output. By asserting them they are hidden from the output.
Diffstat (limited to 'tests/commands')
-rw-r--r--tests/commands/global_test.py10
1 files changed, 6 insertions, 4 deletions
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)