Opened 5 years ago
Closed 5 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 , 5 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 5 years ago
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Summary: | Change assertRaisesMessage and assertWarnsMessage to accept list of expected_message. → Change assertRaisesMessage and assertWarnsMessage to accept list of expected messages. |
Version: | 3.0 → master |
Note:
See TracTickets
for help on using tickets.
I don't see a wide usage, TBH. If you want to check multiple parts of a single message you can always use
assertWarnsRegex()
orassertRaisesRegex()
. I would prefer to keep these assertions straightforward.