Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#17640 closed Bug (fixed)

Exception message causes DeprecationWarning in test_utils

Reported by: Zbigniew Siciarz Owned by: Zbigniew Siciarz
Component: Testing framework Version: 1.4-alpha-1
Severity: Normal Keywords: deprecation, tests
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

When running Django tests on Python 2.7 with -Wall, the tests in regressiontests/test_utils/tests.py raise a DeprecationWarning as follows:

C:\Users\USER\v\django14\django\tests\regressiontests\test_utils\tests.py:149: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6

Attachments (2)

patch_17640.diff (1.4 KB ) - added by Zbigniew Siciarz 12 years ago.
Got rid of DeprecationWarnings.
17640-2.diff (1.5 KB ) - added by Claude Paroz 12 years ago.
Use assertRaisesRegexp

Download all attachments as: .zip

Change History (7)

by Zbigniew Siciarz, 12 years ago

Attachment: patch_17640.diff added

Got rid of DeprecationWarnings.

comment:1 by Claude Paroz, 12 years ago

Has patch: set
Triage Stage: UnreviewedReady for checkin

comment:2 by Aymeric Augustin, 12 years ago

Patch needs improvement: set
Triage Stage: Ready for checkinAccepted

I think it'd be best to convert these tests to use assertRaises as a context manager instead.

by Claude Paroz, 12 years ago

Attachment: 17640-2.diff added

Use assertRaisesRegexp

comment:3 by Claude Paroz, 12 years ago

Patch needs improvement: unset

Sure, this is better.

comment:4 by Aymeric Augustin, 12 years ago

Resolution: fixed
Status: newclosed

In [17492]:

Fixed #17640 -- Avoided a DeprecationWarning in the test suite. Thanks zsiciarz and claudep.

comment:5 by Aymeric Augustin, 12 years ago

I've marked the regexps as raw strings for clarity (even though it isn't necessary, strictly speaking).

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