Opened 5 years ago

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

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by rodriguealcazar

Changed 5 years ago by rodriguealcazar

comment:1 Changed 5 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 5 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(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