From 659a410aec1b0d6e4d736168971e528dc5b4ce06 Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Thu, 11 Apr 2024 16:22:01 +0100 Subject: [PATCH] Discard changes to tests/functional/test_singular_tests.py --- tests/functional/test_singular_tests.py | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/functional/test_singular_tests.py diff --git a/tests/functional/test_singular_tests.py b/tests/functional/test_singular_tests.py new file mode 100644 index 00000000000..a4b9d05b510 --- /dev/null +++ b/tests/functional/test_singular_tests.py @@ -0,0 +1,34 @@ +import pytest + +from dbt.tests.util import run_dbt + +single_test_sql = """ +{{ config(warn_if = '>0', error_if ="> 10") }} + +select 1 as issue +""" + + +class TestSingularTestWarnError: + @pytest.fixture(scope="class") + def tests(self): + return {"single_test.sql": single_test_sql} + + def test_singular_test_warn_error(self, project): + results = run_dbt(["--warn-error", "test"], expect_pass=False) + assert results.results[0].status == "fail" + + def test_singular_test_warn_error_options(self, project): + results = run_dbt( + ["--warn-error-options", "{'include': 'all'}", "test"], expect_pass=False + ) + assert results.results[0].status == "fail" + + def test_singular_test_equals_warn_error(self, project): + results = run_dbt(["--warn-error", "test"], expect_pass=False) + warn_error_result = results.results[0].status + + results = run_dbt( + ["--warn-error-options", "{'include': 'all'}", "test"], expect_pass=False + ) + assert warn_error_result == results.results[0].status