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
ef1bbada
Commit
ef1bbada
authored
Jan 07, 2017
by
Paul Sokolovsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests/array*: Allow to skip test if "array" is unavailable.
parent
e5a6a263
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
6 deletions
+36
-6
tests/basics/array1.py
tests/basics/array1.py
+6
-1
tests/basics/array_add.py
tests/basics/array_add.py
+6
-1
tests/basics/array_construct.py
tests/basics/array_construct.py
+6
-1
tests/basics/array_construct2.py
tests/basics/array_construct2.py
+6
-1
tests/basics/array_construct_endian.py
tests/basics/array_construct_endian.py
+6
-1
tests/basics/array_q.py
tests/basics/array_q.py
+6
-1
No files found.
tests/basics/array1.py
View file @
ef1bbada
import
array
try
:
import
array
except
ImportError
:
import
sys
print
(
"SKIP"
)
sys
.
exit
()
a
=
array
.
array
(
'B'
,
[
1
,
2
,
3
])
print
(
a
,
len
(
a
))
...
...
tests/basics/array_add.py
View file @
ef1bbada
# test array + array
import
array
try
:
import
array
except
ImportError
:
import
sys
print
(
"SKIP"
)
sys
.
exit
()
a1
=
array
.
array
(
'I'
,
[
1
])
a2
=
array
.
array
(
'I'
,
[
2
])
...
...
tests/basics/array_construct.py
View file @
ef1bbada
# test construction of array.array from different objects
from
array
import
array
try
:
from
array
import
array
except
ImportError
:
import
sys
print
(
"SKIP"
)
sys
.
exit
()
# tuple, list
print
(
array
(
'b'
,
(
1
,
2
)))
...
...
tests/basics/array_construct2.py
View file @
ef1bbada
from
array
import
array
try
:
from
array
import
array
except
ImportError
:
import
sys
print
(
"SKIP"
)
sys
.
exit
()
# construct from something with unknown length (requires generators)
print
(
array
(
'i'
,
(
i
for
i
in
range
(
10
))))
tests/basics/array_construct_endian.py
View file @
ef1bbada
# test construction of array.array from different objects
from
array
import
array
try
:
from
array
import
array
except
ImportError
:
import
sys
print
(
"SKIP"
)
sys
.
exit
()
# raw copy from bytes, bytearray
print
(
array
(
'h'
,
b'12'
))
tests/basics/array_q.py
View file @
ef1bbada
# test array('q') and array('Q')
from
array
import
array
try
:
from
array
import
array
except
ImportError
:
import
sys
print
(
"SKIP"
)
sys
.
exit
()
print
(
array
(
'q'
))
print
(
array
(
'Q'
))
...
...
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