Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_can_restrict_endianness fails on big-endian s390x #1164

Closed
ginggs opened this issue Mar 12, 2018 · 1 comment · Fixed by #1165
Closed

test_can_restrict_endianness fails on big-endian s390x #1164

ginggs opened this issue Mar 12, 2018 · 1 comment · Fixed by #1165
Assignees
Labels
bug something is clearly wrong here

Comments

@ginggs
Copy link

ginggs commented Mar 12, 2018

Hi!

test_can_restrict_endianness fails on s390x, the only big-endian architecture being tested in Ubuntu.
Links to full tests logs can be found on the following page:
http://autopkgtest.ubuntu.com/packages/p/python-hypothesis/bionic/s390x

Is this by design?

The test fails when dt=dtype('int16') and dt.byteorder == '='

=================================== FAILURES ===================================
_________________________ test_can_restrict_endianness _________________________

    @given(nps.integer_dtypes(endianness='>'))
>   def test_can_restrict_endianness(dt):

tests/numpy/test_gen_data.py:189: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3/dist-packages/hypothesis/core.py:579: in execute
    result = self.test_runner(data, run)
/usr/lib/python3/dist-packages/hypothesis/executors.py:58: in default_new_style_executor
    return function(data)
/usr/lib/python3/dist-packages/hypothesis/core.py:571: in run
    return test(*args, **kwargs)
tests/numpy/test_gen_data.py:189: in test_can_restrict_endianness
    def test_can_restrict_endianness(dt):
/usr/lib/python3/dist-packages/hypothesis/core.py:518: in test
    result = self.test(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dt = dtype('int16')

    @given(nps.integer_dtypes(endianness='>'))
    def test_can_restrict_endianness(dt):
        if dt.itemsize == 1:
            assert dt.byteorder == '|'
        else:
>           assert dt.byteorder == '>'
E           AssertionError

tests/numpy/test_gen_data.py:193: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_can_restrict_endianness(dt=dtype('int16'))
======== 1 failed, 2156 passed, 4 skipped, 1 xfailed in 278.16 seconds =========
@Zac-HD Zac-HD added the bug something is clearly wrong here label Mar 13, 2018
@Zac-HD Zac-HD self-assigned this Mar 13, 2018
@Zac-HD
Copy link
Member

Zac-HD commented Mar 13, 2018

Thanks for the report @ginggs - it looks like our behaviour in this case is correct, but the test is wrong! Given a > (big-endian) argument to the dtype strategy we do always generate big-endian dtypes, but native byte-order is always reported as =.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something is clearly wrong here
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants