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

Method urlopen

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

Source from the content-addressed store, hash-verified

58
59 @contextlib.contextmanager
60 def urlopen(self, *args, **kwargs):
61 resource = args[0]
62 with socket_helper.transient_internet(resource):
63 r = urllib.request.urlopen(*args, **kwargs)
64 try:
65 yield r
66 finally:
67 r.close()
68
69 def test_basic(self):
70 # Simple test expected to pass.

Callers 7

test_basicMethod · 0.95
test_readlinesMethod · 0.95
test_infoMethod · 0.95
test_geturlMethod · 0.95
testURLreadMethod · 0.45
test_getcodeMethod · 0.45
test_bad_addressMethod · 0.45

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected