From 52a1033505a5dc9228039442f03ef7f4ac4de91e Mon Sep 17 00:00:00 2001 From: Phill Ridout Date: Thu, 29 Jan 2015 18:26:00 +0000 Subject: [PATCH] test tidies --- tests/functional/openlp_core_utils/test_utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/functional/openlp_core_utils/test_utils.py b/tests/functional/openlp_core_utils/test_utils.py index 893fb41ca..cca5f6825 100644 --- a/tests/functional/openlp_core_utils/test_utils.py +++ b/tests/functional/openlp_core_utils/test_utils.py @@ -200,7 +200,7 @@ class TestUtils(TestCase): Test the delete_file function when it successfully deletes a file """ # GIVEN: A mocked os which returns True when os.path.exists is called - with patch('openlp.core.utils.os', **{'path.exists.return_value': False}) as mocked_os: + with patch('openlp.core.utils.os', **{'path.exists.return_value': False}): # WHEN: Calling delete_file with a file path result = delete_file('path/file.ext') @@ -213,7 +213,7 @@ class TestUtils(TestCase): Test the delete_file function when the file to remove does not exist """ # GIVEN: A mocked os which returns False when os.path.exists is called - with patch('openlp.core.utils.os', **{'path.exists.return_value': False}) as mocked_os: + with patch('openlp.core.utils.os', **{'path.exists.return_value': False}): # WHEN: Calling delete_file with a file path result = delete_file('path/file.ext') @@ -227,8 +227,7 @@ class TestUtils(TestCase): """ # GIVEN: A mocked os which returns True when os.path.exists is called and raises an OSError when os.remove is # called. - with patch('openlp.core.utils.os', **{'path.exists.return_value': True, - 'path.exists.side_effect': OSError}) as mocked_os, \ + with patch('openlp.core.utils.os', **{'path.exists.return_value': True, 'path.exists.side_effect': OSError}), \ patch('openlp.core.utils.log') as mocked_log: # WHEN: Calling delete_file with a file path