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

Method test_lockf_exclusive

Lib/test/test_fcntl.py:174–183  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

172 @unittest.skipIf(platform.system() == "AIX", "AIX returns PermissionError")
173 @requires_subprocess()
174 def test_lockf_exclusive(self):
175 self.f = open(TESTFN, 'wb+')
176 cmd = fcntl.LOCK_EX | fcntl.LOCK_NB
177 fcntl.lockf(self.f, cmd)
178 mp = multiprocessing.get_context('spawn')
179 p = mp.Process(target=try_lockf_on_other_process_fail, args=(TESTFN, cmd))
180 p.start()
181 p.join()
182 fcntl.lockf(self.f, fcntl.LOCK_UN)
183 self.assertEqual(p.exitcode, 0)
184
185 @unittest.skipIf(platform.system() == "AIX", "AIX returns PermissionError")
186 @requires_subprocess()

Callers

nothing calls this directly

Calls 6

openFunction · 0.50
get_contextMethod · 0.45
ProcessMethod · 0.45
startMethod · 0.45
joinMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected