Skip to content

Test failures with numpy 1.14.0 #232

Open

Description

@FRidh
________________________________ test_validate _________________________________

    def test_validate():
        assert validate(int, 1)
>       assert validate('int', 1)
E       AssertionError: assert False
E        +  where False = validate('int', 1)

datashape/tests/test_user.py:8: AssertionError
___________________________ test_nested_iteratables ____________________________

    def test_nested_iteratables():
>       assert validate('2 * 3 * int', [(1, 2, 3), (4, 5, 6)])
E       AssertionError: assert False
E        +  where False = validate('2 * 3 * int', [(1, 2, 3), (4, 5, 6)])

datashape/tests/test_user.py:19: AssertionError
_____________________________ test_validate_dicts ______________________________

    def test_validate_dicts():
>       assert validate('{x: int, y: int}', {'x': 1, 'y': 2})
E       AssertionError: assert False
E        +  where False = validate('{x: int, y: int}', {'x': 1, 'y': 2})

datashape/tests/test_user.py:26: AssertionError
________________________ test_tuples_can_be_records_too ________________________

    def test_tuples_can_be_records_too():
>       assert validate('{x: int, y: real}', (1, 2.0))
E       AssertionError: assert False
E        +  where False = validate('{x: int, y: real}', (1, 2.0))

datashape/tests/test_user.py:36: AssertionError
  • datashape 0.5.4
  • Python 2.7 and 3.6

Activity

  1. mingwandroid commented on Apr 29, 2018

    @mingwandroid

    Does anyone know anything about this failure?

  2. kglowinski commented on Jul 25, 2018

    @kglowinski
    Contributor

    It has to do with changes in numpy in 1.14.0+: https://github.com/numpy/numpy/blob/master/doc/release/1.14.0-notes.rst#future-changes

    In particular:

    np.issubdtype will stop downcasting dtype-like arguments. It might be expected that issubdtype(np.float32, 'float64') and issubdtype(np.float32, np.float64) mean the same thing - however, there was an undocumented special case that translated the former into issubdtype(np.float32, np.floating), giving the surprising result of True.

    This means that all the validate tests are now just meaningless for what they were testing with 'int'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions