File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -454,6 +454,9 @@ def _validate_and_normalize_test(self) -> None:
454454 query = outputs .get ("query" )
455455 partial = outputs .pop ("partial" , None )
456456
457+ if ctes is None and query is None :
458+ _raise_error ("Incomplete test, outputs must contain 'query' or 'ctes'" , self .path )
459+
457460 def _normalize_rows (
458461 values : t .List [Row ] | t .Dict ,
459462 name : str ,
Original file line number Diff line number Diff line change @@ -1185,6 +1185,27 @@ def test_unknown_column_error() -> None:
11851185 )
11861186
11871187
1188+ def test_invalid_outputs_error () -> None :
1189+ with pytest .raises (TestError , match = "Incomplete test, outputs must contain 'query' or 'ctes'" ):
1190+ _create_test (
1191+ body = load_yaml (
1192+ """
1193+ test_foo:
1194+ model: sushi.foo
1195+ inputs:
1196+ raw:
1197+ - id: 1
1198+ outputs:
1199+ rows:
1200+ - id: 1
1201+ """
1202+ ),
1203+ test_name = "test_foo" ,
1204+ model = _create_model ("SELECT id FROM raw" ),
1205+ context = Context (config = Config (model_defaults = ModelDefaultsConfig (dialect = "duckdb" ))),
1206+ )
1207+
1208+
11881209def test_empty_rows (sushi_context : Context ) -> None :
11891210 _check_successful_or_raise (
11901211 _create_test (
You can’t perform that action at this time.
0 commit comments