code: def test_name_undefined_in_if(env):
      t = env.from_string(
          "{% if x is defined %}{{ x is f }}{% endif %}"
      )
      assert t.render() == ""
  
      with pytest.raises(
          TemplateRuntimeError, match="No test named 'f'"
      ):
          t.render(x=1)
  
imports: import pytest
  from markupsafe import Markup
  from jinja2 import Environment
  from jinja2 import TemplateAssertionError
  from jinja2 import TemplateRuntimeError
label_desc: Use image node_id 2 for calling a global function with example usage: test_name_undefined_in_if(env) without return types