MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_close

Method test_close

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

Source from the content-addressed store, hash-verified

5358 self.assertRaises(TypeError, os.scandir, obj)
5359
5360 def test_close(self):
5361 self.create_file("file.txt")
5362 self.create_file("file2.txt")
5363 iterator = os.scandir(self.path)
5364 next(iterator)
5365 iterator.close()
5366 # multiple closes
5367 iterator.close()
5368 with self.check_no_resource_warning():
5369 del iterator
5370
5371 def test_context_manager(self):
5372 self.create_file("file.txt")

Callers

nothing calls this directly

Calls 4

create_fileMethod · 0.95
nextFunction · 0.85
scandirMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected