def METHOD_NAME(tmp_path):
    population_size = 100
    _cohortextractor(
        study="test_patients_from_file",
        args=[
            "generate_cohort",
            "--expectations-population",
            str(population_size),
            "--output-dir",
            tmp_path,
            "--study-definition",
            "study_definition_controls",
        ],
    )
    with open(tmp_path / "input_controls.csv") as f:
        contents = list(csv.reader(f))
    # The number of rows in the output file must equal the number of rows in the
    # user-supplied CSV file
    assert len(contents) == 2
    assert contents[0] == [
        "patient_id",
        "case_index_date",
        "exists_in_file",
        "bmi_date_measured",
        "age",
        "bmi",
    ]
    # The following values come from the user-supplied CSV file
    assert contents[1][0] == "1"  # integer
    assert contents[1][1] == "2021-01-01"
    assert contents[1][2] == "1"  # boolean