def test_attributes_writable(self):
if not self.rw_type:
self.skipTest("no writable type to test")
m = self.check_attributes_with_type(self.rw_type)
self.assertEqual(m.readonly, False)
# Disabled: unicode uses the old buffer API in 2.x
#def test_getbuffer(self):
## Test PyObject_GetBuffer() on a memoryview object.
#for tp in self._types:
#b = tp(self._source)
#oldrefcount = sys.getrefcount(b)
#m = self._view(b)
#oldviewrefcount = sys.getrefcount(m)
#s = unicode(m, "utf-8")
#self._check_contents(tp, b, s.encode("utf-8"))
#self.assertEqual(sys.getrefcount(m), oldviewrefcount)
#m = None
#self.assertEqual(sys.getrefcount(b), oldrefcount)
test_memoryview.py 文件源码
python
阅读 28
收藏 0
点赞 0
评论 0
评论列表
文章目录