Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#17049 closed Cleanup/optimization (fixed)

The test suite should be deprecation-warning clean

Reported by: carljm Owned by: nobody
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

Right now running the test suite with -Wall results in quite a few warnings. Really, when we deprecate something, we should modify its tests to use the catch_warnings context manager and test for the deprecation warning, as well as preventing it from bubbling up to the test suite.

Unfortunately catch_warnings is Python 2.6+. Since this probably isn't important enough to warrant a backport, just leaving this ticket as a reminder to clean this up once we hit 2.6 as minimum supported Python version.

Attachments (1)

17049-1.diff (20.4 KB) - added by claudep 3 years ago.
Use catch_warnings more extensively

Download all attachments as: .zip

Change History (6)

comment:1 Changed 3 years ago by Alex

  • Component changed from Uncategorized to Testing framework
  • Triage Stage changed from Unreviewed to Accepted
  • Version changed from 1.3 to SVN

comment:2 Changed 3 years ago by claudep

After commit b52672d77822e88752cb178c8a359adde83ff0ba, the test suite with python2.6 + SQLite and PostgreSQL seems to be warnings-free. Needs confirmation for other combinations.

https://github.com/django/django/commit/b52672d77822e88752cb178c8a359adde83ff0ba

Changed 3 years ago by claudep

Use catch_warnings more extensively

comment:3 Changed 3 years ago by claudep

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

Patch committed in 10cf3c64273db407402ea9723569dfc8d059e186

I think the only remaining warnings/errors are related to gis tests, and there are exiting tickets for those: #17958 and #17959. So closing this one.

comment:4 Changed 3 years ago by claudep

Oh, and forgot to mention that Aymeric has added -Wall to http://ci.djangoproject.com test suites, so we can check in console output for uncatched warnings.

comment:5 Changed 3 years ago by akaariai

FWIW all tests pass on Oracle 11g with no warnings.

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