From 5d6252fc103f9c6b4e6fd4732c56093dfc23706e Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Sun, 17 Mar 2024 11:56:42 -0700 Subject: [PATCH] Separate snapshot configuration from `MetricFlowTestConfiguration`. --- metricflow/test/fixtures/setup_fixtures.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/metricflow/test/fixtures/setup_fixtures.py b/metricflow/test/fixtures/setup_fixtures.py index d3a25dc552..6d8a5bb3c2 100644 --- a/metricflow/test/fixtures/setup_fixtures.py +++ b/metricflow/test/fixtures/setup_fixtures.py @@ -21,7 +21,17 @@ @dataclass(frozen=True) -class MetricFlowTestConfiguration: +class SnapshotConfiguration: + """Configuration for handling snapshots in a test session.""" + + # Whether to display the snapshot associated with a test session in a browser window. + display_snapshots: bool + # Whether to overwrite any text files that were generated. + overwrite_snapshots: bool + + +@dataclass(frozen=True) +class MetricFlowTestConfiguration(SnapshotConfiguration): """State that is shared between tests during a testing session.""" sql_engine_url: str @@ -31,12 +41,8 @@ class MetricFlowTestConfiguration: # Where tables for test data sets should be stored. mf_source_schema: str - # Whether to display the snapshot associated with a test session in a browser window. - display_snapshots: bool # Whether to display the graph associated with a test session in a browser window. display_graphs: bool - # Whether to overwrite any text files that were generated. - overwrite_snapshots: bool # The source schema contains tables that are used for running tests. If this is set, a source schema in the SQL # is created and persisted between runs. The source schema name includes a hash of the tables that should be in