Silence some py3k warnings claiming to affect _pyio

This commit is contained in:
Antoine Pitrou 2009-10-14 18:39:46 +00:00
parent 8d6c9eeef7
commit 79d923b8c4
1 changed files with 6 additions and 2 deletions

View File

@ -129,6 +129,8 @@ class MemoryTestMixin:
pos = memio.tell()
self.assertEqual(memio.truncate(None), pos)
self.assertEqual(memio.tell(), pos)
# Silence a py3k warning
with support.check_warnings():
self.assertRaises(TypeError, memio.truncate, '0')
memio.close()
self.assertRaises(ValueError, memio.truncate, 0)
@ -165,6 +167,8 @@ class MemoryTestMixin:
self.assertEqual(type(memio.read()), type(buf))
memio.seek(0)
self.assertEqual(memio.read(None), buf)
# Silence a py3k warning
with support.check_warnings():
self.assertRaises(TypeError, memio.read, '')
memio.close()
self.assertRaises(ValueError, memio.read)