mirror of https://github.com/celery/kombu.git
Adapt the mock to correctly mock the behaviors as implemented on Python 3.10. Ref #1663.
This commit is contained in:
parent
35f24f1f01
commit
c310364cc0
|
@ -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'))
|
||||
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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue