Skip to content

Failing four test_*_interp tests #80

@mcepl

Description

@mcepl

When running the test suite while packaging pyUSID for openSUSE I get these four tests failing:

[   60s] + PYTHONPATH=/home/abuild/rpmbuild/BUILDROOT/python-pyUSID-0.0.10-0.x86_64/usr/lib/python3.9/site-packages
[   60s] + PYTHONDONTWRITEBYTECODE=1
[   60s] + pytest-3.9 --ignore=_build.python39 --ignore=_build.python310 --ignore=_build.python38 -v
[   60s] ============================= test session starts ==============================
[   60s] platform linux -- Python 3.9.12, pytest-7.1.1, pluggy-1.0.0 -- /usr/bin/python3.9
[   60s] cachedir: .pytest_cache
[   60s] rootdir: /home/abuild/rpmbuild/BUILD/pyUSID-0.0.10, configfile: setup.cfg, testpaths: tests, docs
[   62s] collecting ... collected 358 items
...
[   74s] =================================== FAILURES ===================================
[   74s] ________________________ TestBinning.test_custom_interp ________________________
[   74s]
[   74s] self = <tests.io.test_image_translator.TestBinning testMethod=test_custom_interp>
[   74s]
[   74s]     def test_custom_interp(self):
[   74s] >       self.main_translate(bin_factor=2, interp_func=Image.NEAREST)
[   74s]
[   74s] tests/io/test_image_translator.py:235:
[   74s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[   74s] tests/io/test_image_translator.py:188: in main_translate
[   74s]     self.assertEqual(hdf_utils.get_attr(h5_meas_grp, key), expected_val)
[   74s] E   ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
[   74s] ----------------------------- Captured stdout call -----------------------------
[   74s] [[0]]
[   74s] ____________________ TestBinning.test_single_default_interp ____________________
[   74s]
[   74s] self = <tests.io.test_image_translator.TestBinning testMethod=test_single_default_interp>
[   74s]
[   74s]     def test_single_default_interp(self):
[   74s] >       self.main_translate(bin_factor=2)
[   74s]
[   74s] tests/io/test_image_translator.py:209:
[   74s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[   74s] tests/io/test_image_translator.py:188: in main_translate
[   74s]     self.assertEqual(hdf_utils.get_attr(h5_meas_grp, key), expected_val)
[   74s] E   ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
[   74s] ----------------------------- Captured stdout call -----------------------------
[   74s] [[0]]
[   74s] ____________________ TestBinning.test_tuple_default_interp _____________________
[   74s]
[   74s] self = <tests.io.test_image_translator.TestBinning testMethod=test_tuple_default_interp>
[   74s]
[   74s]     def test_tuple_default_interp(self):
[   74s] >       self.main_translate(bin_factor=(1, 2))
[   74s]
[   74s] tests/io/test_image_translator.py:212:
[   74s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[   74s] tests/io/test_image_translator.py:188: in main_translate
[   74s]     self.assertEqual(hdf_utils.get_attr(h5_meas_grp, key), expected_val)
[   74s] E   ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
[   74s] ----------------------------- Captured stdout call -----------------------------
[   74s] [[0]]
[   74s] _____________ TestNormalization.test_normalize_and_default_interp ______________
[   74s]
[   74s] self = <tests.io.test_image_translator.TestNormalization testMethod=test_normalize_and_default_interp>
[   74s]
[   74s]     def test_normalize_and_default_interp(self):
[   74s] >       self.main_translate(normalize=True, bin_factor=2)
[   74s]
[   74s] tests/io/test_image_translator.py:249:
[   74s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[   74s] tests/io/test_image_translator.py:188: in main_translate
[   74s]     self.assertEqual(hdf_utils.get_attr(h5_meas_grp, key), expected_val)
[   74s] E   ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
[   74s] ----------------------------- Captured stdout call -----------------------------
[   74s] [[0]]
[   74s] =========================== short test summary info ============================
[   74s] FAILED tests/io/test_image_translator.py::TestBinning::test_custom_interp - V...
[   74s] FAILED tests/io/test_image_translator.py::TestBinning::test_single_default_interp
[   74s] FAILED tests/io/test_image_translator.py::TestBinning::test_tuple_default_interp
[   74s] FAILED tests/io/test_image_translator.py::TestNormalization::test_normalize_and_default_interp
[   74s] ================= 4 failed, 354 passed, 423 warnings in 14.09s =================

Complete build log shows all packages used and steps taken to reproduce.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions