def METHOD_NAME(self):
    super(Jinja2Test, self).METHOD_NAME()
    patch()
    # prevent cache effects when using Template('code...')
    try:
        jinja2.environment._spontaneous_environments.clear()
    except AttributeError:
        jinja2.utils.clear_caches()
    Pin.override(jinja2.environment.Environment, tracer=self.tracer)