Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-16291

str(Image) tests too strict about formatting

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
    • Templates:
    • Story Points:
      2
    • Sprint:
      AP F18-6
    • Team:
      Alert Production

      Description

      While the changes introduced in DM-15682 passed formal testing, I discovered that they do not pass if afw is built against NumPy 1.13 – that version of numpy includes more whitespace in the array than the test expects:

      AssertionError: '[[0. 0.]\n [0. 0.]]' not found in '[[ 0.  0.]\n [ 0.  0.]], bbox=(minimum=(0, 0), maximum=(1, 1))'
      

      While the build failure can be worked around by upgrading NumPy to 1.14 or later (which will soon be required anyway), the consensus on #dm-build-problems was that any future formatting changes in NumPy would break the test again.

      Please modify the tests so that they're less sensitive to NumPy's formatting decisions, preferably while keeping some diagnostic of whether the array is included in the string.

        Attachments

          Container Issues

            Issue Links

              Activity

                People

                • Assignee:
                  swinbank John Swinbank
                  Reporter:
                  krzys Krzysztof Findeisen
                  Reviewers:
                  Krzysztof Findeisen
                  Watchers:
                  Jim Bosch, John Parejko, John Swinbank, Krzysztof Findeisen
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Summary Panel