@@ -2685,6 +2685,10 @@ def test_model_test_text_result_reporting_no_traceback(
26852685 else :
26862686 result .addFailure (test , (e .__class__ , e , e .__traceback__ ))
26872687
2688+ # Since we're simulating an error/failure, this doesn't go through the
2689+ # test runner logic, so we need to manually set how many tests were ran
2690+ result .testsRun = 1
2691+
26882692 with capture_output () as captured_output :
26892693 get_console ().log_test_results (result , "duckdb" )
26902694
@@ -2729,3 +2733,23 @@ def test_timestamp_normalization() -> None:
27292733 context = Context (config = Config (model_defaults = ModelDefaultsConfig (dialect = "duckdb" ))),
27302734 ).run ()
27312735 )
2736+
2737+
2738+ @use_terminal_console
2739+ def test_disable_test_logging_if_no_tests_found (mocker : MockerFixture , tmp_path : Path ) -> None :
2740+ init_example_project (tmp_path , dialect = "duckdb" )
2741+
2742+ config = Config (
2743+ default_connection = DuckDBConnectionConfig (),
2744+ model_defaults = ModelDefaultsConfig (dialect = "duckdb" ),
2745+ default_test_connection = DuckDBConnectionConfig (concurrent_tasks = 8 ),
2746+ )
2747+
2748+ rmtree (tmp_path / "tests" )
2749+
2750+ with capture_output () as captured_output :
2751+ context = Context (paths = tmp_path , config = config )
2752+ context .plan (no_prompts = True , auto_apply = True )
2753+
2754+ output = captured_output .stdout
2755+ assert "test" not in output .lower ()
0 commit comments