class_docstr: Custom CliRunner class to handle passing context.
class_docstr_tok: ["Custom","CliRunner","class","to","handle","passing","context","."]
code: def run(
      self, cli: click.BaseCommand, args: Optional[Sequence[str]] = None
  ) -> Result:  # noqa: D
      current_dir = os.getcwd()
      os.chdir(self.project_path)
      result = super().invoke(cli, args, obj=self.cli_context)
      os.chdir(current_dir)
      return result
  
imports: from __future__ import annotations
  import os
  import pathlib
  import tempfile
  from typing import Generator, Optional, Sequence
  import click
  import pytest
  from click.testing import CliRunner, Result
  from dbt_semantic_interfaces.protocols.semantic_manifest import SemanticManifest
  from dbt_semantic_interfaces.test_utils import as_datetime
  from typing_extensions import override
  from metricflow.cli.cli_context import CLIContext
  from metricflow.cli.dbt_connectors.dbt_config_accessor import dbtArtifacts, dbtProjectMetadata
  from metricflow.engine.metricflow_engine import MetricFlowEngine
  from metricflow.model.semantic_manifest_lookup import SemanticManifestLookup
  from metricflow.plan_conversion.column_resolver import DunderColumnAssociationResolver
  from metricflow.protocols.sql_client import SqlClient
  from metricflow.test.fixtures.setup_fixtures import dbt_project_dir
  from metricflow.test.time.configurable_time_source import ConfigurableTimeSource
label_desc: Use image node_id 2 for calling the MetricFlowCliRunner obj's underlying member method code with example usage: obj.run(cli, args) and returns: result