Opened 7 years ago

Closed 7 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: UI/UX:

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 7 years ago.
utils.py.2.diff (388 bytes) - added by rodriguealcazar 7 years ago.

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by rodriguealcazar

Attachment: utils.py.diff added

Changed 7 years ago by rodriguealcazar

Attachment: utils.py.2.diff added

comment:1 Changed 7 years ago by rodriguealcazar

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

Something didn't work with the first diff

comment:2 Changed 7 years ago by Russell Keith-Magee

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