MCPcopy Create free account
hub / github.com/python/cpython / test_unlink_dir_fd

Method test_unlink_dir_fd

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

Source from the content-addressed store, hash-verified

1849
1850 @unittest.skipUnless(os.unlink in os.supports_dir_fd, "test needs dir_fd support in os.unlink()")
1851 def test_unlink_dir_fd(self):
1852 with self.prepare() as (dir_fd, name, fullname):
1853 os_helper.create_empty_file(fullname)
1854 posix.stat(fullname) # should not raise exception
1855 try:
1856 posix.unlink(name, dir_fd=dir_fd)
1857 self.assertRaises(OSError, posix.stat, fullname)
1858 except:
1859 self.addCleanup(posix.unlink, fullname)
1860 raise
1861
1862 @unittest.skipUnless(hasattr(os, 'mkfifo') and os.mkfifo in os.supports_dir_fd, "test needs dir_fd support in os.mkfifo()")
1863 def test_mkfifo_dir_fd(self):

Callers

nothing calls this directly

Calls 5

prepareMethod · 0.95
addCleanupMethod · 0.80
statMethod · 0.45
unlinkMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected