Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
e7ce04f9
Commit
e7ce04f9
authored
Mar 27, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Py3 test fixes
--HG-- extra : rebase_source : 255f3e4df8a66d204b2390ea5e566aa758839b94
parent
c65bd42e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
tests/run/numpy_memoryview.pyx
tests/run/numpy_memoryview.pyx
+4
-3
No files found.
tests/run/numpy_memoryview.pyx
View file @
e7ce04f9
...
...
@@ -422,9 +422,10 @@ cdef packed struct StructArray:
@
testcase_numpy_1_5
def
test_memslice_structarray
(
data
,
dtype
):
"""
>>> data = [(range(4), 'spam
\
\
0'), (range(4, 8), 'ham
\
\
0
\
\
0'), (range(8, 12), 'eggs
\
\
0')]
>>> def b(s): return s.encode('ascii')
>>> data = [(range(4), b('spam
\
\
0')), (range(4, 8), b('ham
\
\
0
\
\
0')), (range(8, 12), b('eggs
\
\
0'))]
>>> dtype = np.dtype([('a', '4i'), ('b', '5b')])
>>> test_memslice_structarray([(L,
map(ord, s
)) for L, s in data], dtype)
>>> test_memslice_structarray([(L,
list(map(ord, s)
)) for L, s in data], dtype)
0
1
2
...
...
@@ -468,7 +469,7 @@ def test_memslice_structarray(data, dtype):
for
i
in
range
(
3
):
for
j
in
range
(
4
):
print
myslice
[
i
].
a
[
j
]
print
myslice
[
i
].
b
print
myslice
[
i
].
b
.
decode
(
'ASCII'
)
@
testcase_numpy_1_5
def
test_structarray_errors
(
StructArray
[:]
a
):
...
...
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