code: def test_context_imports(self, test_env):
      t = test_env.from_string(
          '{% import "module" as m %}{{ m.test() }}'
      )
      assert t.render(foo=42) == "[|23]"
      t = test_env.from_string(
          '{% import "module" as m without context %}{{ m.test() }}'
      )
      assert t.render(foo=42) == "[|23]"
      t = test_env.from_string(
          '{% import "module" as m with context %}{{ m.test() }}'
      )
      assert t.render(foo=42) == "[42|23]"
      t = test_env.from_string(
          '{% from "module" import test %}{{ test() }}'
      )
      assert t.render(foo=42) == "[|23]"
      t = test_env.from_string(
          '{% from "module" import test without context %}{{ test() }}'
      )
      assert t.render(foo=42) == "[|23]"
      t = test_env.from_string(
          '{% from "module" import test with context %}{{ test() }}'
      )
      assert t.render(foo=42) == "[42|23]"
  
imports: import pytest
  from jinja2 import DictLoader
  from jinja2 import Environment
  from jinja2.exceptions import TemplateNotFound
  from jinja2.exceptions import TemplatesNotFound
  from jinja2.exceptions import TemplateSyntaxError
label_desc: Use image node_id 1 for calling the TestImports obj's underlying member method code with example usage: obj.test_context_imports(test_env) without return types