def test_missing_lsb_job_id(tmp_path):
    """Test an error when the job id cannot be found."""
    with (
        mock.patch.dict(os.environ, {"LSB_DJOB_RANKFILE": _make_rankfile(tmp_path)}),
        pytest.raises(ValueError, match="Could not find job id in environment variable LSB_JOBID"),
    ):
        LSFEnvironment()
Test an error when the job id cannot be found.
tests/tests_fabric/plugins/environments/test_lsf.py