def METHOD_NAME(fetch_openml_mock: mock.Mock):
    """
    Downloads a small dataset (midwest survey) and performs a bunch of tests
    that asserts the fetching function works correctly.
    We don't download all datasets as it would take way too long:
    see https://github.com/skrub-data/skrub/issues/523
    """
    with TemporaryDirectory() as temp_dir:
        # Download the dataset without loading it in memory.
        dataset = _fetching.fetch_midwest_survey(
            data_directory=temp_dir,
            load_dataframe=False,
        )
        fetch_openml_mock.assert_called_once()
        assert _has_data_id(fetch_openml_mock.call_args, _fetching.MIDWEST_SURVEY_ID)
        fetch_openml_mock.reset_mock()
        assert isinstance(dataset, _fetching.DatasetInfoOnly)
        # Briefly load the dataframe in memory, to test that reading
        # from disk works.
        assert pd.read_csv(dataset.path, **dataset.read_csv_kwargs).shape == (2494, 29)
        assert dataset.name == (
            _fetching.fetch_midwest_survey.__name__[len("fetch_") :]
            .replace("_", " ")
            .capitalize()
        )
        assert dataset.source.startswith("https://www.openml.org/")
        assert str(_fetching.MIDWEST_SURVEY_ID) in dataset.source
        # Now, load it into memory, and expect `fetch_openml`
        # to not be called because the dataset is already on disk.
        dataset = _fetching.fetch_midwest_survey(data_directory=temp_dir)
        fetch_openml_mock.assert_not_called()
        fetch_openml_mock.reset_mock()
        assert dataset.X.shape == (2494, 28)
        assert dataset.y.shape == (2494,)