summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2023-03-12 10:59:27 -0400
committerAsif Saif Uddin <auvipy@gmail.com>2023-03-12 22:33:37 +0600
commitc310364cc039e1e78419b74b490ad2ddb5e017d4 (patch)
tree03e2637f3b7ae8200c64741bba123ae10d258dcb
parent35f24f1f01c7895926a990be0616a4582374749a (diff)
downloadkombu-c310364cc039e1e78419b74b490ad2ddb5e017d4.tar.gz
Adapt the mock to correctly mock the behaviors as implemented on Python 3.10. Ref #1663.
-rw-r--r--t/unit/utils/test_compat.py8
1 files 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()