def test_dead_pid_in_lock_file(tmpdir):
    """Testing whether the process checker returns false when there is a dead pid in the lock file."""
    dead_pid = 134824733
    create_lock_file_with_pid(tmpdir, dead_pid)
    process_checker = ProcessChecker(state_directory=Path(tmpdir))
    assert not process_checker.is_pid_running(dead_pid)
    assert not process_checker.already_running
def test_other_instance_running(tmpdir, background_process):
    """Testing whether the process checker returns true when another process is running."""
    create_lock_file_with_pid(tmpdir, background_process.pid)
    process_checker = ProcessChecker(state_directory=Path(tmpdir))
    assert process_checker.is_pid_running(background_process.pid)
    assert process_checker.already_running