def METHOD_NAME(tmp_path, format):
    population_size = 100
    _cohortextractor(
        study="test_smoketest",
        args=[
            "generate_cohort",
            "--expectations-population",
            str(population_size),
            "--index-date-range",
            "2020-01-01 to 2020-04-01 by month",
            "--output-dir",
            tmp_path,
            "--output-format",
            format,
        ],
    )
    _cohortextractor(
        study="test_smoketest",
        args=[
            "generate_measures",
            "--output-dir",
            tmp_path,
        ],
    )
    # liver_disease_by_stp
    with open(tmp_path / "measure_liver_disease_by_stp.csv") as f:
        contents = list(csv.reader(f))
    assert contents[0] == [
        "stp",
        "has_chronic_liver_disease",
        "population",
        "value",
        "date",
    ]
    assert len(contents) == 1 + (2 * 4)  # Header row + 2 STPs * 4 dates
    dates = set(row[4] for row in contents[1:])
    assert dates == {"2020-01-01", "2020-02-01", "2020-03-01", "2020-04-01"}
    # liver_disease_by_stp_and_sex
    with open(tmp_path / "measure_liver_disease_by_stp_and_sex.csv") as f:
        contents = list(csv.reader(f))
    assert contents[0] == [
        "stp",
        "sex",
        "has_chronic_liver_disease",
        "population",
        "value",
        "date",
    ]
    assert len(contents) == 1 + (2 * 2 * 4)  # Header row + 2 STPs * 2 sexes * 4 dates
    dates = set(row[5] for row in contents[1:])
    assert dates == {"2020-01-01", "2020-02-01", "2020-03-01", "2020-04-01"}
    # liver_disease
    with open(tmp_path / "measure_liver_disease.csv") as f:
        contents = list(csv.reader(f))
    assert contents[0] == [
        "has_chronic_liver_disease",
        "population",
        "value",
        "date",
    ]
    # liver_disease_one_group
    with open(tmp_path / "measure_liver_disease_one_group.csv") as f:
        contents = list(csv.reader(f))
    assert contents[0] == [
        "has_chronic_liver_disease",
        "population",
        "value",
        "date",
    ]
    dates = [row[3] for row in contents[1:]]
    assert dates == ["2020-01-01", "2020-02-01", "2020-03-01", "2020-04-01"]
    populations = [float(row[1]) for row in contents[1:]]
    assert populations == [population_size] * 4