Opened 15 years ago

Closed 15 years ago

#12659 closed (fixed)

KeyError exception instanciated with offending key in test.utils.ContextList.__getitem__

Reported by: rodriguealcazar Owned by: nobody
Component: Testing framework Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In test.utils.ContextList.getitem, a plain KeyError is raised if you look for a key that isn't in any of the context onjects in the list.
This (extremelly tiny) patch just passes the key object when creating the KeyError, so that test failures read a bit clearer.

Attachments (2)

utils.py.diff (278 bytes ) - added by rodriguealcazar 15 years ago.
utils.py.2.diff (388 bytes ) - added by rodriguealcazar 15 years ago.

Download all attachments as: .zip

Change History (4)

by rodriguealcazar, 15 years ago

Attachment: utils.py.diff added

by rodriguealcazar, 15 years ago

Attachment: utils.py.2.diff added

comment:1 by rodriguealcazar, 15 years ago

Something didn't work with the first diff

comment:2 by Russell Keith-Magee, 15 years ago

Resolution: fixed
Status: newclosed

(In [12274]) Fixed #12659 -- Return a more meaningful KeyError message when ContextList lookups fail. Thanks to rodriguealcazar for the suggestion.

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