diff --git a/.changes/unreleased/Under the Hood-20230913-141651.yaml b/.changes/unreleased/Under the Hood-20230913-141651.yaml new file mode 100644 index 00000000000..6381d338787 --- /dev/null +++ b/.changes/unreleased/Under the Hood-20230913-141651.yaml @@ -0,0 +1,6 @@ +kind: Under the Hood +body: Fix test_numeric_values to look for more specific strings +time: 2023-09-13T14:16:51.453247-04:00 +custom: + Author: gshank + Issue: "8470" diff --git a/tests/functional/show/test_show.py b/tests/functional/show/test_show.py index 42bddb2ddee..67bb8e645bd 100644 --- a/tests/functional/show/test_show.py +++ b/tests/functional/show/test_show.py @@ -82,13 +82,15 @@ def test_numeric_values(self, project): (_, log_output) = run_dbt_and_capture( ["show", "--select", "sample_number_model", "--output", "json"] ) + # json log output needs the escapes removed for string matching + log_output = log_output.replace("\\", "") assert "Previewing node 'sample_number_model'" not in log_output - assert "1.0" not in log_output - assert "1" in log_output - assert "3.0" in log_output - assert "4.3" in log_output - assert "5" in log_output - assert "5.0" not in log_output + assert '"float_to_int_field": 1.0' not in log_output + assert '"float_to_int_field": 1' in log_output + assert '"float_field": 3.0' in log_output + assert '"float_with_dec_field": 4.3' in log_output + assert '"int_field": 5' in log_output + assert '"int_field": 5.0' not in log_output class TestShowNumericNulls(ShowBase): @@ -97,13 +99,15 @@ def test_numeric_values_with_nulls(self, project): (_, log_output) = run_dbt_and_capture( ["show", "--select", "sample_number_model_with_nulls", "--output", "json"] ) + # json log output needs the escapes removed for string matching + log_output = log_output.replace("\\", "") assert "Previewing node 'sample_number_model_with_nulls'" not in log_output - assert "1.0" not in log_output - assert "1" in log_output - assert "3.0" in log_output - assert "4.3" in log_output - assert "5" in log_output - assert "5.0" not in log_output + assert '"float_to_int_field": 1.0' not in log_output + assert '"float_to_int_field": 1' in log_output + assert '"float_field": 3.0' in log_output + assert '"float_with_dec_field": 4.3' in log_output + assert '"int_field": 5' in log_output + assert '"int_field": 5.0' not in log_output class TestShowInline(ShowBase):