Skip to content

Commit

Permalink
Update exception catching
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed Nov 26, 2024
1 parent e474fab commit fbe779a
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django.test import override_settings
from posthog.hogql.errors import QueryError
from posthog.hogql_queries.experiments.experiment_trends_query_runner import ExperimentTrendsQueryRunner
from posthog.models.experiment import Experiment, ExperimentHoldout
from posthog.models.feature_flag.feature_flag import FeatureFlag
Expand Down Expand Up @@ -621,10 +620,10 @@ def test_query_runner_with_invalid_data_warehouse_table_name(self):
query=ExperimentTrendsQuery(**experiment.metrics[0]["query"]), team=self.team
)
with freeze_time("2023-01-07"):
with self.assertRaises(QueryError) as context:
with self.assertRaises(KeyError) as context:
query_runner.calculate()

self.assertEqual(str(context.exception), 'Unknown table "invalid_table_name".')
self.assertEqual(str(context.exception), "'invalid_table_name'")

@freeze_time("2020-01-01T12:00:00Z")
def test_query_runner_with_avg_math(self):
Expand Down

0 comments on commit fbe779a

Please sign in to comment.