Skip to content

Commit

Permalink
test(jinja): iter none type error
Browse files Browse the repository at this point in the history
  • Loading branch information
devmessias committed Oct 28, 2024
1 parent 7209f3e commit c9b8667
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/unit/test_jinja.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,23 @@ def test_type_error(self) -> None:
with self.assertRaises(DbtRuntimeTypeError):
render_template(template, ctx)

def test_type_error_iter_none(self) -> None:
jinja_string = """
{% set mylist = None %}
{% for item in mylist %}
select '{{ item }}' as my_item
{{ 'union all' if not loop.last }}
{% endfor %}
"""
ctx = {"config": self._dummy_config}

template = get_template(jinja_string, ctx)
with self.assertRaises(DbtRuntimeTypeError):
render_template(template, ctx)


bar_block = """{% mytype bar %}
{# a comment
Expand Down

0 comments on commit c9b8667

Please sign in to comment.