mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #30137 -- Replaced OSError aliases with the canonical OSError.
Used more specific errors (e.g. FileExistsError) as appropriate.
This commit is contained in:
parent
7444f32527
commit
7785e03ba8
33 changed files with 60 additions and 69 deletions
4
tests/cache/tests.py
vendored
4
tests/cache/tests.py
vendored
|
@ -1448,8 +1448,8 @@ class FileBasedCacheTests(BaseCacheTests, TestCase):
|
|||
self.assertEqual(cache.get('foo', 'baz'), 'baz')
|
||||
|
||||
def test_get_does_not_ignore_non_filenotfound_exceptions(self):
|
||||
with mock.patch('builtins.open', side_effect=IOError):
|
||||
with self.assertRaises(IOError):
|
||||
with mock.patch('builtins.open', side_effect=OSError):
|
||||
with self.assertRaises(OSError):
|
||||
cache.get('foo')
|
||||
|
||||
def test_empty_cache_file_considered_expired(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue