Package: src:satpy
Version: 0.43.0-7
Severity: important
Tags: sid trixie
User: debian-pyt...@lists.debian.org
Usertags: python3.12

satpy's autopkg tests fail with Python 3.12:

[...]
541s =================================== FAILURES =================================== 541s _____________ TestSceneResampling.test_resample_reduce_data_toggle _____________
541s
541s self = <satpy.tests.scene_tests.test_resampling.TestSceneResampling object at 0x7fd3a5be6fc0>
541s rs = <MagicMock name='resample_dataset' id='140546315196640'>
541s
541s     @mock.patch('satpy.scene.resample_dataset')
541s     def test_resample_reduce_data_toggle(self, rs):
541s """Test that the Scene can be reduced or not reduced during resampling."""
541s         from pyresample.geometry import AreaDefinition
541s
541s         rs.side_effect = self._fake_resample_dataset_force_20x20
541s         proj_str = ('+proj=lcc +datum=WGS84 +ellps=WGS84 '
541s '+lon_0=-95. +lat_0=25 +lat_1=25 +units=m +no_defs') 541s target_area = AreaDefinition('test', 'test', 'test', proj_str, 4, 4, (-1000., -1500., 1000., 1500.)) 541s area_def = AreaDefinition('test', 'test', 'test', proj_str, 5, 5, (-1000., -1500., 1000., 1500.))
541s         area_def.get_area_slices = mock.MagicMock()
541s         get_area_slices = area_def.get_area_slices
541s get_area_slices.return_value = (slice(0, 3, None), slice(0, 3, None)) 541s area_def_big = AreaDefinition('test', 'test', 'test', proj_str, 10, 10, (-1000., -1500., 1000., 1500.))
541s         area_def_big.get_area_slices = mock.MagicMock()
541s         get_area_slices_big = area_def_big.get_area_slices
541s get_area_slices_big.return_value = (slice(0, 6, None), slice(0, 6, None))
541s
541s         # Test that data reduction can be disabled
541s         scene = Scene(filenames=['fake1_1.txt'], reader='fake1')
541s         scene.load(['comp19'])
541s         scene['comp19'].attrs['area'] = area_def
541s         scene['comp19_big'] = xr.DataArray(
541s             da.zeros((10, 10)), dims=('y', 'x'),
541s             attrs=scene['comp19'].attrs.copy())
541s         scene['comp19_big'].attrs['area'] = area_def_big
541s         scene['comp19_copy'] = scene['comp19'].copy()
541s         orig_slice_data = scene._slice_data
541s # we force the below order of processing to test that success isn't
541s         # based on data of the same resolution being processed together
541s         test_order = [
541s             make_cid(**scene['comp19'].attrs),
541s             make_cid(**scene['comp19_big'].attrs),
541s             make_cid(**scene['comp19_copy'].attrs),
541s         ]
541s with mock.patch('satpy.scene.Scene._slice_data') as slice_data, \ 541s mock.patch('satpy.dataset.dataset_walker') as ds_walker:
541s             ds_walker.return_value = test_order
541s             slice_data.side_effect = orig_slice_data
541s             scene.resample(target_area, reduce_data=False)
541s             assert not slice_data.called
541s             assert not get_area_slices.called
541s             scene.resample(target_area)
541s >           assert slice_data.called_once
541s
541s /usr/lib/python3/dist-packages/satpy/tests/scene_tests/test_resampling.py:322: 541s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
541s
541s self = <MagicMock name='_slice_data' id='140546297116096'>, name = 'called_once'
541s
541s     def __getattr__(self, name):
541s         if name in {'_mock_methods', '_mock_unsafe'}:
541s             raise AttributeError(name)
541s         elif self._mock_methods is not None:
541s             if name not in self._mock_methods or name in _all_magics:
541s raise AttributeError("Mock object has no attribute %r" % name)
541s         elif _is_magic(name):
541s             raise AttributeError(name)
541s if not self._mock_unsafe and (not self._mock_methods or name not in self._mock_methods): 541s if name.startswith(('assert', 'assret', 'asert', 'aseert', 'assrt')) or name in _ATTRIB_DENY_LIST:
541s >               raise AttributeError(
541s                     f"{name!r} is not a valid assertion. Use a spec "
541s f"for the mock if {name!r} is meant to be an attribute.") 541s E AttributeError: 'called_once' is not a valid assertion. Use a spec for the mock if 'called_once' is meant to be an attribute.
541s
541s /usr/lib/python3.12/unittest/mock.py:663: AttributeError
[...]
542s =========================== short test summary info ============================ 542s FAILED ../../../../usr/lib/python3/dist-packages/satpy/tests/scene_tests/test_resampling.py::TestSceneResampling::test_resample_reduce_data_toggle 542s = 1 failed, 2091 passed, 8 skipped, 94 deselected, 5 xfailed, 1 xpassed, 1069 warnings in 250.52s (0:04:10) =

Reply via email to