diff options
author | Lucas Hoffmann <l-m-h@web.de> | 2018-01-08 23:51:31 +0100 |
---|---|---|
committer | Lucas Hoffmann <l-m-h@web.de> | 2018-01-08 23:51:31 +0100 |
commit | 3fa66571c76993dc1f9726703826c7dea73296bc (patch) | |
tree | 64ec41044208a7e4d7b87e07fb0ac818fb924fba /tests/settings | |
parent | 4a67ce79d775adea8626436ae73308621f2c572a (diff) |
Use message of test assert function instead of print()
This makes it possible to silence the test output with normal unittest
settings (e.g. command line parameters).
Diffstat (limited to 'tests/settings')
-rw-r--r-- | tests/settings/manager_test.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/settings/manager_test.py b/tests/settings/manager_test.py index eb2f37fd..67c2a239 100644 --- a/tests/settings/manager_test.py +++ b/tests/settings/manager_test.py @@ -108,13 +108,10 @@ class TestSettingsManager(unittest.TestCase): if all([s in msg for s in unknown_settings]): success = True break - else: - print('Could not find all unknown settings in logging.info.\n' - 'Unknown settings:') - print(unknown_settings) - print('Calls to mocked logging.info:') - print(mock_logger.info.call_args_list) - self.assertTrue(success) + self.assertTrue(success, msg='Could not find all unknown settings in ' + 'logging.info.\nUnknown settings:\n{}\nCalls to mocked' + ' logging.info:\n{}'.format( + unknown_settings, mock_logger.info.call_args_list)) def test_read_notmuch_config_doesnt_exist(self): with tempfile.NamedTemporaryFile(delete=False) as f: |