mirror of
https://github.com/python/cpython.git
synced 2025-11-07 00:51:49 +00:00
Issue #7142: Fix uses of unicode in memoryview objects
This commit is contained in:
parent
196b0925ca
commit
08133af12e
2 changed files with 9 additions and 2 deletions
|
|
@ -54,6 +54,12 @@ def test_iter(self):
|
|||
m = self._view(b)
|
||||
self.assertEqual(list(m), [m[i] for i in range(len(m))])
|
||||
|
||||
def test_repr(self):
|
||||
for tp in self._types:
|
||||
b = tp(self._source)
|
||||
m = self._view(b)
|
||||
self.assertIsInstance(m.__repr__(), str)
|
||||
|
||||
def test_setitem_readonly(self):
|
||||
if not self.ro_type:
|
||||
return
|
||||
|
|
@ -156,6 +162,7 @@ def test_compare(self):
|
|||
def check_attributes_with_type(self, tp):
|
||||
m = self._view(tp(self._source))
|
||||
self.assertEquals(m.format, self.format)
|
||||
self.assertIsInstance(m.format, str)
|
||||
self.assertEquals(m.itemsize, self.itemsize)
|
||||
self.assertEquals(m.ndim, 1)
|
||||
self.assertEquals(m.shape, (6,))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue