mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-106300: Improve assertRaises(Exception)
usages in tests (GH-106302)
This commit is contained in:
parent
80b9b3a517
commit
6e6a4cd523
7 changed files with 20 additions and 12 deletions
|
@ -2738,7 +2738,7 @@ class _ZeroCopyFileTest(object):
|
|||
def test_same_file(self):
|
||||
self.addCleanup(self.reset)
|
||||
with self.get_files() as (src, dst):
|
||||
with self.assertRaises(Exception):
|
||||
with self.assertRaises((OSError, _GiveupOnFastCopy)):
|
||||
self.zerocopy_fun(src, src)
|
||||
# Make sure src file is not corrupted.
|
||||
self.assertEqual(read_file(TESTFN, binary=True), self.FILEDATA)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue