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