def METHOD_NAME(self):
    env = Environment(
        loader=DictLoader({"a": "{% macro x() %}{{ foobar }}{% endmacro %}"})
    )
    t = env.from_string(
        "{% set foobar = 42 %}{% from 'a' import x with context %}{{ x() }}"
    )
    assert t.render() == "42"