aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Plangger <planrichi@gmail.com>2020-02-20 15:16:57 -0300
committerRichard Plangger <planrichi@gmail.com>2020-02-20 15:16:57 -0300
commitdd9030583213137223805655beadffaf7eac4999 (patch)
tree699814635e86096e8fa4f23f18945206a914f001 /extra_tests
parentadd python3.6 constants, they will be exposed to pypy2.7 as well. (diff)
downloadpypy-dd9030583213137223805655beadffaf7eac4999.tar.gz
pypy-dd9030583213137223805655beadffaf7eac4999.tar.bz2
pypy-dd9030583213137223805655beadffaf7eac4999.zip
byteorder related issue, check the byte order of that machine
Diffstat (limited to 'extra_tests')
-rw-r--r--extra_tests/ctypes_tests/test_structures.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/extra_tests/ctypes_tests/test_structures.py b/extra_tests/ctypes_tests/test_structures.py
index b6bd075942..fa6ed900ae 100644
--- a/extra_tests/ctypes_tests/test_structures.py
+++ b/extra_tests/ctypes_tests/test_structures.py
@@ -1,6 +1,7 @@
from ctypes import *
import pytest
+import sys
def test_subclass_initializer():
@@ -207,6 +208,9 @@ def test_memoryview():
)
mv = memoryview(c_array)
- assert mv.format == 'T{<h:a:<h:b:}'
+ if sys.byteorder == 'little':
+ assert mv.format == 'T{<h:a:<h:b:}'
+ else:
+ assert mv.format == 'T{>h:a:>h:b:}'
assert mv.shape == (2, 3)
assert mv.itemsize == 4