From 174f32250ec54950badbaf3878d9d6acc8328ddd Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 7 Oct 2011 15:19:03 -0400 Subject: [PATCH] Mention that people subscribe with **extra. --- docs/signals.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/signals.rst b/docs/signals.rst index c381da92..75487800 100644 --- a/docs/signals.rst +++ b/docs/signals.rst @@ -55,7 +55,7 @@ to the template:: @contextmanager def captured_templates(app): recorded = [] - def record(sender, template, context): + def record(sender, template, context, **extra): recorded.append((template, context)) template_rendered.connect(record, app) try: @@ -73,6 +73,9 @@ This can now easily be paired with a test client:: assert template.name == 'index.html' assert len(context['items']) == 10 +Make sure to subscribe with an extra ``**extra`` argument so that your +calls don't fail if Flask introduces new arguments to the signals. + All the template rendering in the code issued by the application `app` in the body of the `with` block will now be recorded in the `templates` variable. Whenever a template is rendered, the template object as well as