From: Armin Ronacher Date: Wed, 28 Dec 2016 12:32:42 +0000 (+0100) Subject: Added test for macro async support X-Git-Tag: 2.9~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9853794a6bbb5734e0e0bf4e4fc8e0c52fd00372;p=thirdparty%2Fjinja.git Added test for macro async support --- diff --git a/tests/test_async.py b/tests/test_async.py index c5d75ead..02160403 100644 --- a/tests/test_async.py +++ b/tests/test_async.py @@ -40,3 +40,15 @@ def test_await_on_calls(): rv = run(func) assert rv == '65' + + +@pytest.mark.skipif(not have_async_gen, reason='No async generators') +def test_await_and_macros(): + t = Template('{% macro foo(x) %}[{{ x }}]{% endmacro %}{{ foo(42) }}', + enable_async=True) + + async def func(): + return await t.render_async() + + rv = run(func) + assert rv == '[42]'