@pytest.fixture(autouse=True, scope='session')
def instrument_jinja():
    import jinja2
    old_render = jinja2.Template.render

    def instrumented_render(self, *args, **kwargs):
        context = dict(*args, **kwargs)
        test.signals.template_rendered.send(
            sender=self, template=self, context=context)
        return old_render(self, *args, **kwargs)

    jinja2.Template.render = instrumented_render
Make sure the "templates" list in a response is properly updated, even
dataset/ETHPy150Open mozilla/addons-server/conftest.py/instrument_jinja