def METHOD_NAME():
    with environ({"DAGSTER_HOME": ""}):
        repository = mock.MagicMock(spec=ExternalRepository)
        repository.get_external_schedules.return_value = [mock.MagicMock()]
        instance = mock.MagicMock(spec=DagsterInstance)
        with pytest.raises(
            click.UsageError, match=re.escape("The environment variable $DAGSTER_HOME is not set.")
        ):
            check_repo_and_scheduler(repository, instance)