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

Method _test_single

Lib/test/test_unicode_file.py:104–118  ·  view source on GitHub ↗
(self, filename)

Source from the content-addressed store, hash-verified

102 # The '_test' functions 'entry points with params' - ie, what the
103 # top-level 'test' functions would be if they could take params
104 def _test_single(self, filename):
105 remove_if_exists(filename)
106 create_empty_file(filename)
107 try:
108 self._do_single(filename)
109 finally:
110 os.unlink(filename)
111 self.assertTrue(not os.path.exists(filename))
112 # and again with os.open.
113 f = os.open(filename, os.O_CREAT | os.O_WRONLY)
114 os.close(f)
115 try:
116 self._do_single(filename)
117 finally:
118 os.unlink(filename)
119
120 # The 'test' functions are unittest entry points, and simply call our
121 # _test functions with each of the filename combinations we wish to test

Callers 1

test_single_filesMethod · 0.95

Calls 8

_do_singleMethod · 0.95
create_empty_fileFunction · 0.90
remove_if_existsFunction · 0.85
assertTrueMethod · 0.80
unlinkMethod · 0.45
existsMethod · 0.45
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected