Commit a474ddf9 authored by Damien George's avatar Damien George

tests/basics: Add coverage tests for memoryview attributes.

parent 90fae917
......@@ -94,3 +94,9 @@ try:
memoryview(array.array('i'))[0:2] = b'1234'
except ValueError:
print('ValueError')
# invalid attribute
try:
memoryview(b'a').noexist
except AttributeError:
print('AttributeError')
......@@ -7,3 +7,9 @@ except:
for code in ['b', 'h', 'i', 'l', 'q', 'f', 'd']:
print(memoryview(array(code)).itemsize)
# shouldn't be able to store to the itemsize attribute
try:
memoryview(b'a').itemsize = 1
except AttributeError:
print('AttributeError')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment