From 7785e03ba89aafbd949191f126361fb9103cb980 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Mon, 28 Jan 2019 07:01:35 -0800 Subject: Fixed #30137 -- Replaced OSError aliases with the canonical OSError. Used more specific errors (e.g. FileExistsError) as appropriate. --- tests/cache/tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/cache') diff --git a/tests/cache/tests.py b/tests/cache/tests.py index 0dd9208710..9f717cfa23 100644 --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -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): -- cgit v1.3