From c310364cc039e1e78419b74b490ad2ddb5e017d4 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 12 Mar 2023 10:59:27 -0400 Subject: Adapt the mock to correctly mock the behaviors as implemented on Python 3.10. Ref #1663. --- t/unit/utils/test_compat.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/t/unit/utils/test_compat.py b/t/unit/utils/test_compat.py index 462db143..d1fa0055 100644 --- a/t/unit/utils/test_compat.py +++ b/t/unit/utils/test_compat.py @@ -16,10 +16,14 @@ def test_entrypoints(): 'kombu.utils.compat.importlib_metadata.entry_points', create=True ) as iterep: eps = [Mock(), Mock()] - iterep.return_value = {'kombu.test': eps} + iterep.return_value = ( + {'kombu.test': eps} if sys.version_info < (3, 10) else eps) assert list(entrypoints('kombu.test')) - iterep.assert_called_with() + if sys.version_info < (3, 10): + iterep.assert_called_with() + else: + iterep.assert_called_with(group='kombu.test') eps[0].load.assert_called_with() eps[1].load.assert_called_with() -- cgit v1.2.1