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

Method test_lockf_share

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

Source from the content-addressed store, hash-verified

185 @unittest.skipIf(platform.system() == "AIX", "AIX returns PermissionError")
186 @requires_subprocess()
187 def test_lockf_share(self):
188 self.f = open(TESTFN, 'wb+')
189 cmd = fcntl.LOCK_SH | fcntl.LOCK_NB
190 fcntl.lockf(self.f, cmd)
191 mp = multiprocessing.get_context('spawn')
192 p = mp.Process(target=try_lockf_on_other_process, args=(TESTFN, cmd))
193 p.start()
194 p.join()
195 fcntl.lockf(self.f, fcntl.LOCK_UN)
196 self.assertEqual(p.exitcode, 0)
197
198 @cpython_only
199 def test_flock_overflow(self):

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