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,7 +129,9 @@ class MemoryTestMixin:
pos = memio.tell()
self.assertEqual(memio.truncate(None), pos)
self.assertEqual(memio.tell(), pos)
self.assertRaises(TypeError, memio.truncate, '0')
# Silence a py3k warning
with support.check_warnings():
self.assertRaises(TypeError, memio.truncate, '0')
memio.close()
self.assertRaises(ValueError, memio.truncate, 0)
@ -165,7 +167,9 @@ class MemoryTestMixin:
self.assertEqual(type(memio.read()), type(buf))
memio.seek(0)
self.assertEqual(memio.read(None), buf)
self.assertRaises(TypeError, memio.read, '')
# Silence a py3k warning
with support.check_warnings():
self.assertRaises(TypeError, memio.read, '')
memio.close()
self.assertRaises(ValueError, memio.read)