79643697

Date: 2025-05-29 10:01:47
Score: 0.5
Natty:
Report link

For session scoped fixtures, I've made this one (return_value with object initialization allows iterate only once):

foo = AsyncMock(spec=FooClass)
bar = Mock(spec=BarClass)

async def _g(*_, **__):
    yield bar

foo.__aiter__ = Mock(side_effect=_g)
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Mastermind