MCPcopy Index your code
hub / github.com/python/cpython / urlretrieve

Method urlretrieve

Lib/test/test_urllibnet.py:158–165  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

156
157 @contextlib.contextmanager
158 def urlretrieve(self, *args, **kwargs):
159 resource = args[0]
160 with socket_helper.transient_internet(resource):
161 file_location, info = urllib.request.urlretrieve(*args, **kwargs)
162 try:
163 yield file_location, info
164 finally:
165 os_helper.unlink(file_location)
166
167 def test_basic(self):
168 # Test basic functionality.

Callers 15

test_basicMethod · 0.95
test_specified_pathMethod · 0.95
test_headerMethod · 0.95
test_data_headerMethod · 0.95
test_reporthookMethod · 0.95
retrieve_with_retriesFunction · 0.80
test_basicMethod · 0.80
test_copyMethod · 0.80
test_reporthookMethod · 0.80

Calls 1

unlinkMethod · 0.45

Tested by

no test coverage detected