Opened 7 years ago

Closed 7 years ago

#29363 closed Cleanup/optimization (fixed)

Use unittest assertWarns methods instead of warnings.catch_warnings/simplefilter/assertions in the test suite.

Reported by: Simon Charette Owned by: Morgan Aubert
Component: Testing framework Version: 2.0
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

The assertWarns and assertWarnsRegex method have been introduced in Python 3.2 and should remove a lot of boilerplate around warnings testing in the test suite.

https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertWarns

Change History (5)

comment:1 by Simon Charette, 7 years ago

Easy pickings: set

comment:2 by Tim Graham, 7 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Morgan Aubert, 7 years ago

Owner: changed from nobody to Morgan Aubert
Status: newassigned

comment:4 by Morgan Aubert, 7 years ago

Has patch: set

comment:5 by Tim Graham <timograham@…>, 7 years ago

Resolution: fixed
Status: assignedclosed

In 704443ac:

Fixed #29363 -- Added SimpleTestCase.assertWarnsMessage().

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