MCPcopy Create free account
hub / github.com/pytest-dev/pytest / response

Method response

testing/test_pastebin.py:178–180  ·  view source on GitHub ↗
(url, data)

Source from the content-addressed store, hash-verified

176 import urllib.request
177
178 def response(url, data):
179 stream = io.BytesIO(b"something bad occurred")
180 return stream
181
182 monkeypatch.setattr(urllib.request, "urlopen", response)
183 result = pastebin.create_new_paste(b"full-paste-contents")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected