Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
a474ddf9
Commit
a474ddf9
authored
May 14, 2019
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests/basics: Add coverage tests for memoryview attributes.
parent
90fae917
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
tests/basics/memoryview1.py
tests/basics/memoryview1.py
+6
-0
tests/basics/memoryview_itemsize.py
tests/basics/memoryview_itemsize.py
+6
-0
No files found.
tests/basics/memoryview1.py
View file @
a474ddf9
...
...
@@ -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'
)
tests/basics/memoryview_itemsize.py
View file @
a474ddf9
...
...
@@ -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'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment