Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#10667 closed (fixed)

Test failure in regressiontests.templates.tests.Templates

Reported by: Glenn Maynard Owned by: nobody
Component: Template system Version: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Straightforward test failure in r10222 with 2.5:

======================================================================
ERROR: test_templates (regressiontests.templates.tests.Templates)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/glenn/django/tests/regressiontests/templates/tests.py", line 212, in test_templates
    exc_type, exc_value, exc_tb = sys.exc_info()
NameError: global name 'sys' is not defined

Attachments (1)

fix-template-test.diff (382 bytes ) - added by Glenn Maynard 16 years ago.

Download all attachments as: .zip

Change History (8)

by Glenn Maynard, 16 years ago

Attachment: fix-template-test.diff added

comment:1 by Alex Gaynor, 16 years ago

This runs fine for me under 2.5. Can you provide some more details?

comment:2 by Glenn Maynard, 16 years ago

                except Exception:
                    exc_type, exc_value, exc_tb = sys.exc_info()
                    if exc_type != result:
                        tb = '\n'.join(traceback.format_exception(exc_type, exc_value, exc_tb))
                        failures.append("Template test (TEMPLATE_STRING_IF_INVALID='%s'): %s -- FAILED. Got %s, exception: %s\n%s" % (invalid_str, name, exc_type, exc_value, tb))
                    continue

sys.exc_info is being used, and sys isn't being imported. Can you check:

  • Is this code path being reached for you? (If not, something about this test has a nondeterministic code path, which is probably a bug.)
  • If so, then where is the sys module being imported for you?

comment:3 by Alex Gaynor, 16 years ago

No it doesn't hit that code path for me, but sys is clearly used there and not imported so we should just add the import.

comment:4 by Alex Gaynor, 16 years ago

milestone: 1.1
Triage Stage: UnreviewedReady for checkin

comment:5 by Gary Wilson, 16 years ago

Resolution: fixed
Status: newclosed

(In [10244]) Fixed #10667 -- Added missing sys import.

comment:6 by Gary Wilson, 16 years ago

(In [10245]) [1.0.X]: Fixed #10667 -- Added missing sys import.

Backport of r10244 from trunk.

comment:7 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

Note: See TracTickets for help on using tickets.
Back to Top