classification
Title: AsyncMock says it raises StopIteration but that is Impossible
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: fried, lisroach, xtreak
Priority: normal Keywords: patch

Created on 2019-11-20 00:14 by fried, last changed 2019-11-21 18:16 by lisroach. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 17269 merged fried, 2019-11-20 00:38
Messages (2)
msg357008 - (view) Author: Jason Fried (fried) * Date: 2019-11-20 00:14
If an AsyncMock uses a side_effect that is an Iterable, if called more than items exist its suppose to raise StopIteration according to the docs but PEP 479 says that is impossible. 

My Suggestion is that we update the docs and the code to Raise a StopAsyncIteration since it will not be converted to a RuntimeError
msg357191 - (view) Author: Lisa Roach (lisroach) * (Python committer) Date: 2019-11-21 18:16
PR merged, thanks Jason!
History
Date User Action Args
2019-11-21 18:16:58lisroachsetstatus: open -> closed
resolution: fixed
messages: + msg357191

stage: patch review -> resolved
2019-11-21 10:33:52xtreaksetnosy: + xtreak
2019-11-20 00:38:18friedsetkeywords: + patch
stage: patch review
pull_requests: + pull_request16762
2019-11-20 00:14:29friedcreate