Code

#19589 closed Cleanup/optimization (fixed)

assertRegexpMatches is deprecated on Python 3

Reported by: claudep Owned by: aaugustin
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

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.

Attachments (0)

Change History (3)

comment:1 Changed 15 months ago by aaugustin

  • Triage Stage changed from Design decision needed to Accepted

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

comment:2 Changed 15 months ago by aaugustin

  • Owner changed from nobody to aaugustin
  • Status changed from new to assigned

comment:3 Changed 15 months ago by Aymeric Augustin <aymeric.augustin@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In 55416e235d95b6168034236e5b1cdc581d544cc6:

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.