Opened 12 years ago

Closed 12 years ago

#19589 closed Cleanup/optimization (fixed)

assertRegexpMatches is deprecated on Python 3

Reported by: Claude Paroz Owned by: Aymeric Augustin
Component: Testing framework Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

We have currently three occurrences of assertRegexpMatches in Django testing code, and those raise a DeprecationWarning on Python 3.

We can:

  1. add a compatibility function in six, like we did for assertRaisesRegexp/assertRaisesRegex
  2. it has been suggested on IRC to add those aliases on SimpleTestCase instead, probably a little cleaner, but then the warning will be shown when those methods are used on a bare unittest.TestCase.

Change History (3)

comment:1 by Aymeric Augustin, 12 years ago

Triage Stage: Design decision neededAccepted

I'd add that to our six customizations and document it.

comment:2 by Aymeric Augustin, 12 years ago

Owner: changed from nobody to Aymeric Augustin
Status: newassigned

comment:3 by Aymeric Augustin <aymeric.augustin@…>, 12 years ago

Resolution: fixed
Status: assignedclosed

In 55416e235d95b6168034236e5b1cdc581d544cc6:

Fixed #19589 -- assertRegexpMatches is deprecated in Python 3.3.

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