def METHOD_NAME(tmp_path):
    tmp_config_file_path = tmp_path / 'config'
    environ = {'AWS_CONFIG_FILE': str(tmp_config_file_path)}
    def _do_create_client(
        service,
        profile,
        client_args=None,
        config_file_contents=None,
        environment=None,
    ):
        environ.update(environment)
        with open(tmp_config_file_path, 'w') as f:
            f.write(config_file_contents)
            f.flush()
        return botocore.session.Session(profile=profile).create_client(
            service, **client_args
        )
    with mock.patch('os.environ', environ):
        yield _do_create_client