summaryrefslogtreecommitdiff
path: root/tests/files/tests.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-01-28 07:01:35 -0800
committerTim Graham <timograham@gmail.com>2019-01-28 11:15:06 -0500
commit7785e03ba89aafbd949191f126361fb9103cb980 (patch)
tree5776f7063604285445cfcebf6efb42fd5d063f60 /tests/files/tests.py
parent7444f3252757ed4384623e5afd7dcfeef3e0c74e (diff)
Fixed #30137 -- Replaced OSError aliases with the canonical OSError.
Used more specific errors (e.g. FileExistsError) as appropriate.
Diffstat (limited to 'tests/files/tests.py')
-rw-r--r--tests/files/tests.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/files/tests.py b/tests/files/tests.py
index b50061649a..1c005dde57 100644
--- a/tests/files/tests.py
+++ b/tests/files/tests.py
@@ -355,8 +355,9 @@ class FileMoveSafeTests(unittest.TestCase):
handle_a, self.file_a = tempfile.mkstemp()
handle_b, self.file_b = tempfile.mkstemp()
- # file_move_safe should raise an IOError exception if destination file exists and allow_overwrite is False
- with self.assertRaises(IOError):
+ # file_move_safe() raises OSError if the destination file exists and
+ # allow_overwrite is False.
+ with self.assertRaises(FileExistsError):
file_move_safe(self.file_a, self.file_b, allow_overwrite=False)
# should allow it and continue on if allow_overwrite is True