diff options
Diffstat (limited to 'tests/files')
| -rw-r--r-- | tests/files/tests.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/files/tests.py b/tests/files/tests.py index 2ce4d0139d..6eb7f30d61 100644 --- a/tests/files/tests.py +++ b/tests/files/tests.py @@ -287,7 +287,8 @@ class FileMoveSafeTests(unittest.TestCase): handle_b, self.file_b = tempfile.mkstemp() # file_move_safe should raise an IOError exception if destination file exists and allow_overwrite is False - self.assertRaises(IOError, lambda: file_move_safe(self.file_a, self.file_b, allow_overwrite=False)) + with self.assertRaises(IOError): + file_move_safe(self.file_a, self.file_b, allow_overwrite=False) # should allow it and continue on if allow_overwrite is True self.assertIsNone(file_move_safe(self.file_a, self.file_b, allow_overwrite=True)) |
