summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_io.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-03-25 08:07:07 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-03-25 08:07:07 (GMT)
commit47b4557679154a645780b2e44dd7a4a2c62b5d12 (patch)
tree88b9552b0993ef10f926579c16ebf690532687c3 /Lib/test/test_io.py
parent633ebda3ba57428835d27866d8567af1c857fcd2 (diff)
downloadcpython-47b4557679154a645780b2e44dd7a4a2c62b5d12.zip
cpython-47b4557679154a645780b2e44dd7a4a2c62b5d12.tar.gz
cpython-47b4557679154a645780b2e44dd7a4a2c62b5d12.tar.bz2
test_io: ignore DeprecationWarning on bytes path on Windows
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r--Lib/test/test_io.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 37b9b2d..db074ca 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -364,7 +364,11 @@ class IOTest(unittest.TestCase):
def test_open_handles_NUL_chars(self):
fn_with_NUL = 'foo\0bar'
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):
with self.open(support.TESTFN, "wb", buffering=0) as f: