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

Method test_close

Lib/test/test_os/test_os.py:5084–5093  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5082 self.assertRaises(TypeError, os.scandir, obj)
5083
5084 def test_close(self):
5085 self.create_file("file.txt")
5086 self.create_file("file2.txt")
5087 iterator = os.scandir(self.path)
5088 next(iterator)
5089 iterator.close()
5090 # multiple closes
5091 iterator.close()
5092 with self.check_no_resource_warning():
5093 del iterator
5094
5095 def test_context_manager(self):
5096 self.create_file("file.txt")

Callers

nothing calls this directly

Calls 3

create_fileMethod · 0.95
scandirMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected