Add a better error message for no-more-responses
@@ -97,7 +97,10 @@ def _mock_wsgi_adapter(mock):
"""
def adapter(environ, start_response):
# type: (Environ, StartResponse) -> Body
+ try:
responder = mock(environ, start_response)
+ except StopIteration:
+ raise RuntimeError('Ran out of mocked responses.')
return responder(environ, start_response)
return adapter
