mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-71253: Match _io exception in _pyio (gh-133985)
Test was only testing _io, expanded to cover _pyio. Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This commit is contained in:
parent
84d5f8d799
commit
06eaf4055c
3 changed files with 7 additions and 3 deletions
|
@ -918,7 +918,7 @@ class IOTest(unittest.TestCase):
|
|||
def badopener(fname, flags):
|
||||
return -1
|
||||
with self.assertRaises(ValueError) as cm:
|
||||
open('non-existent', 'r', opener=badopener)
|
||||
self.open('non-existent', 'r', opener=badopener)
|
||||
self.assertEqual(str(cm.exception), 'opener returned -1')
|
||||
|
||||
def test_bad_opener_other_negative(self):
|
||||
|
@ -926,7 +926,7 @@ class IOTest(unittest.TestCase):
|
|||
def badopener(fname, flags):
|
||||
return -2
|
||||
with self.assertRaises(ValueError) as cm:
|
||||
open('non-existent', 'r', opener=badopener)
|
||||
self.open('non-existent', 'r', opener=badopener)
|
||||
self.assertEqual(str(cm.exception), 'opener returned -2')
|
||||
|
||||
def test_opener_invalid_fd(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue