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

Method setUp

Lib/test/test_urllib.py:103–114  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

101 """
102
103 def setUp(self):
104 # Create a temp file to use for testing
105 self.text = bytes("test_urllib: %s\n" % self.__class__.__name__,
106 "ascii")
107 f = open(os_helper.TESTFN, 'wb')
108 try:
109 f.write(self.text)
110 finally:
111 f.close()
112 self.pathname = os_helper.TESTFN
113 self.quoted_pathname = urllib.parse.quote(os.fsencode(self.pathname))
114 self.returned_obj = urllib.request.urlopen("file:%s" % self.quoted_pathname)
115
116 def tearDown(self):
117 """Shut down the open object"""

Callers

nothing calls this directly

Calls 5

quoteMethod · 0.80
openFunction · 0.50
writeMethod · 0.45
closeMethod · 0.45
urlopenMethod · 0.45

Tested by

no test coverage detected