From d5be95d649ec964a8fe7e73273d7bae8faeb20da Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Mon, 8 Jan 2018 23:57:48 +0100 Subject: Move code out of with block The code doesn't need the context manager to be active, hence it can run outside of the with block. --- tests/settings/manager_test.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/settings') diff --git a/tests/settings/manager_test.py b/tests/settings/manager_test.py index 67c2a239..e5d26b9e 100644 --- a/tests/settings/manager_test.py +++ b/tests/settings/manager_test.py @@ -102,12 +102,12 @@ class TestSettingsManager(unittest.TestCase): with mock.patch('alot.settings.utils.logging') as mock_logger: SettingsManager(alot_rc=f.name) - success = False - for call_args in mock_logger.info.call_args_list: - msg = call_args[0][0] - if all([s in msg for s in unknown_settings]): - success = True - break + success = False + for call_args in mock_logger.info.call_args_list: + msg = call_args[0][0] + if all([s in msg for s in unknown_settings]): + success = True + break self.assertTrue(success, msg='Could not find all unknown settings in ' 'logging.info.\nUnknown settings:\n{}\nCalls to mocked' ' logging.info:\n{}'.format( -- cgit v1.2.3