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

Method prepare

Lib/test/test_os/test_posix.py:1656–1665  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1654
1655 @contextmanager
1656 def prepare(self):
1657 TestPosixDirFd.count += 1
1658 name = f'{os_helper.TESTFN}_{self.count}'
1659 base_dir = f'{os_helper.TESTFN}_{self.count}base'
1660 posix.mkdir(base_dir)
1661 self.addCleanup(posix.rmdir, base_dir)
1662 fullname = os.path.join(base_dir, name)
1663 assert not os.path.exists(fullname)
1664 with os_helper.open_dir_fd(base_dir) as dir_fd:
1665 yield (dir_fd, name, fullname)
1666
1667 @contextmanager
1668 def prepare_file(self):

Callers 11

prepare_fileMethod · 0.95
check_statlike_dir_fdMethod · 0.95
test_link_dir_fdMethod · 0.95
test_mkdir_dir_fdMethod · 0.95
test_mknod_dir_fdMethod · 0.95
test_open_dir_fdMethod · 0.95
test_readlink_dir_fdMethod · 0.95
test_rename_dir_fdMethod · 0.95
test_symlink_dir_fdMethod · 0.95
test_unlink_dir_fdMethod · 0.95
test_mkfifo_dir_fdMethod · 0.95

Calls 4

addCleanupMethod · 0.80
mkdirMethod · 0.45
joinMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected