Skip to content

Random error #22

Open
Open
@NotSqrt

Description

@NotSqrt

Hi,

I am facing a random error in my tests, with django 1.8.12, coverage 4.0.3 and django_coverage_plugin 1.3 (and seemingly only on my CI server using ubuntu precise 32bit, not our developer machines using ubuntu >= 14.04 64bit):

django_coverage_plugin/plugin.py", line 170, in line_number_range
    assert frame.f_code.co_name == 'render'
AssertionError

(Side note, as it is an AssertionError exception, the test reports it as a failure, not an error)

It seems to be called from django/template/engine.py, line 168 (https://github.com/django/django/blob/1.8.12/django/template/engine.py#L168):

    def get_template(self, template_name, dirs=_dirs_undefined):
        """
        Returns a compiled Template object for the given template name,
        handling template inheritance recursively.
        """
        # ... removed for brevity
        if not hasattr(template, 'render'):  # <<-- fails here
            # template needs to be compiled
            template = Template(template, origin, template_name, engine=self)

This call comes from a fairly standard return render_to_string(template_name, context.flatten()) in a template tag.

I've managed to get a shell at the point of failure, and frame.f_code.co_name is indeed 'get_template'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions