def METHOD_NAME(self):
    self.f = open(TESTFN, 'wb+')
    cmd = fcntl.LOCK_SH | fcntl.LOCK_NB
    fcntl.lockf(self.f, cmd)
    p = Process(target=try_lockf_on_other_process, args=(TESTFN, cmd))
    p.start()
    p.join()
    fcntl.lockf(self.f, fcntl.LOCK_UN)
    self.assertEqual(p.exitcode, 0)