def METHOD_NAME(request, monkeypatch):
    """
    Pytest fixture to run a test case both with and without tilde paths.
    In the tilde-path case, calls like self.data('filename.fits') will
    produce '~/filename.fits', and environment variables will be temporarily
    modified so that '~' resolves to the data directory.
    """
    # This checks the value specified in the fixture annotation
    if request.param:
        # `request.instance` refers to the test case that's using this fixture.
        request.instance.monkeypatch = monkeypatch
        request.instance.set_home_as_data()
        request.instance.set_paths_via_pathlib(request.param == "pathlib")