mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
test_io: ignore DeprecationWarning on bytes path on Windows
This commit is contained in:
parent
633ebda3ba
commit
47b4557679
1 changed files with 5 additions and 1 deletions
|
@ -364,7 +364,11 @@ class IOTest(unittest.TestCase):
|
||||||
def test_open_handles_NUL_chars(self):
|
def test_open_handles_NUL_chars(self):
|
||||||
fn_with_NUL = 'foo\0bar'
|
fn_with_NUL = 'foo\0bar'
|
||||||
self.assertRaises(ValueError, self.open, fn_with_NUL, 'w')
|
self.assertRaises(ValueError, self.open, fn_with_NUL, 'w')
|
||||||
self.assertRaises(ValueError, self.open, bytes(fn_with_NUL, 'ascii'), 'w')
|
|
||||||
|
bytes_fn = bytes(fn_with_NUL, 'ascii')
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter("ignore", DeprecationWarning)
|
||||||
|
self.assertRaises(ValueError, self.open, bytes_fn, 'w')
|
||||||
|
|
||||||
def test_raw_file_io(self):
|
def test_raw_file_io(self):
|
||||||
with self.open(support.TESTFN, "wb", buffering=0) as f:
|
with self.open(support.TESTFN, "wb", buffering=0) as f:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue