Opened 4 years ago

Closed 4 years ago

#31237 closed New feature (wontfix)

Change assertRaisesMessage and assertWarnsMessage to accept list of expected messages.

Reported by: Hasan Ramezani Owned by: Hasan Ramezani
Component: Testing framework Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently, both assertRaisesMessage and assertWarnsMessage accept a string for expected_message.
I think it would be good to accept a string or a list of string as expected_message.
It would be useful when we want to test the existence of multiple strings in the error message.

Change History (2)

comment:1 by Hasan Ramezani, 4 years ago

Owner: changed from nobody to Hasan Ramezani
Status: newassigned

comment:2 by Mariusz Felisiak, 4 years ago

Resolution: wontfix
Status: assignedclosed
Summary: Change assertRaisesMessage and assertWarnsMessage to accept list of expected_message.Change assertRaisesMessage and assertWarnsMessage to accept list of expected messages.
Version: 3.0master

I don't see a wide usage, TBH. If you want to check multiple parts of a single message you can always use assertWarnsRegex() or assertRaisesRegex(). I would prefer to keep these assertions straightforward.

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