Opened 6 years ago

Closed 6 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: master
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


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 Changed 6 years ago by Aymeric Augustin

Triage Stage: Design decision neededAccepted

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

comment:2 Changed 6 years ago by Aymeric Augustin

Owner: changed from nobody to Aymeric Augustin
Status: newassigned

comment:3 Changed 6 years ago by Aymeric Augustin <aymeric.augustin@…>

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