def METHOD_NAME(grains, pkgrepo, state_tree):
    managed_sls_contents = """
    salttest:
      pkgrepo.managed:
        - enabled: 1
        - gpgcheck: 1
        - comments:
          - '# Salt Test'
        - refresh: 1
    {% if grains['osmajorrelease'] == 15 %}
        - baseurl: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/
        - humanname: openSUSE Backports for SLE 15 SP4
        - gpgkey: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/repodata/repomd.xml.key
    {% elif grains['osfullname'] == 'openSUSE Tumbleweed' %}
        - baseurl: http://download.opensuse.org/tumbleweed/repo/oss/
        - humanname: openSUSE Tumbleweed OSS
        - gpgkey: https://download.opensuse.org/tumbleweed/repo/oss/repodata/repomd.xml.key
    {% endif %}
    """
    absent_sls_contents = """
    salttest:
      pkgrepo:
        - absent
    """
    modified_sls_contents = """
    salttest:
      pkgrepo.managed:
        - enabled: 1
        - gpgcheck: 1
        - comments:
          - '# Salt Test (modified)'
        - refresh: 1
    {% if grains['osmajorrelease'] == 15 %}
        - baseurl: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/
        - humanname: Salt modified Backports
        - gpgkey: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP4/standard/repodata/repomd.xml.key
    {% elif grains['osfullname'] == 'openSUSE Tumbleweed' %}
        - baseurl: http://download.opensuse.org/tumbleweed/repo/oss/
        - humanname: Salt modified OSS
        - gpgkey: https://download.opensuse.org/tumbleweed/repo/oss/repodata/repomd.xml.key
    {% endif %}
    """
    managed_state_file = pytest.helpers.temp_file(
        "pkgrepo/managed.sls", managed_sls_contents, state_tree
    )
    absent_state_file = pytest.helpers.temp_file(
        "pkgrepo/absent.sls", absent_sls_contents, state_tree
    )
    modified_state_file = pytest.helpers.temp_file(
        "pkgrepo/modified.sls", modified_sls_contents, state_tree
    )
    try:
        with managed_state_file, absent_state_file, modified_state_file:
            yield
    finally:
        pass