code: def test_level3_required(self, env):
      env = Environment(
          loader=DictLoader(
              {
                  "default": "{% block x required %}{% endblock %}",
                  "level1": "{% extends 'default' %}",
                  "level2": "{% extends 'level1' %}{% block x %}[2]{% endblock %}",
                  "level3": "{% extends 'level2' %}",
              }
          )
      )
      t1 = env.get_template("level1")
      t2 = env.get_template("level2")
      t3 = env.get_template("level3")
  
      with pytest.raises(
          TemplateRuntimeError, match="Required block 'x' not found"
      ):
          assert t1.render()
  
      assert t2.render() == "[2]"
      assert t3.render() == "[2]"
  
imports: import pytest
  from jinja2 import DictLoader
  from jinja2 import Environment
  from jinja2 import TemplateRuntimeError
  from jinja2 import TemplateSyntaxError
label_desc: Use image node_id 17 for calling the TestInheritance obj's underlying member method code with example usage: obj.test_level3_required(env) without return types