Opened 12 years ago
Closed 12 years ago
#20503 closed Bug (fixed)
django.test._doctest deprecation warning too agressive
| Reported by: | Anssi Kääriäinen | Owned by: | nobody |
|---|---|---|---|
| Component: | Testing framework | Version: | 1.6-alpha-1 |
| 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
Both django.test.simple and django.test.testcases import django.test._doctest, and django.test._doctest gives deprecation warning on import. So, any project using any tests will give a false deprecation warning. Applies to 1.6 alpha.
I think giving the warning when some _doctest code is actually used is the correct approach.
Change History (4)
comment:1 by , 12 years ago
| Version: | master → 1.6-alpha-1 |
|---|
comment:2 by , 12 years ago
comment:4 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
django.test.simpleis itself deprecated (the entire module), so I'm not concerned about it usingdjango.test._doctest, butdjango.test.testcasesis a problematic oversight. Not sure why I never noticed these deprecation warnings in my tests.I'm hesitant to make your suggested fix for a couple reasons:
django.test._doctest; adding a deprecation warning to all of them would be quite invasive surgery.The only alternative I see is to move
OutputCheckerandDocTestRunnerfromdjango.test.testcasestodjango.test.simple(which is where the other deprecated test-running code lives, and is the only place they are used; it's a bit strange that they are defined indjango.test.testcasesto begin with). This would quarantine all of the deprecated code in the two deprecated modules (django.test.simpleanddjango.test._doctest) and solve the problem. This has the potential to break user code which imported those two classes directly fromdjango.test.testcases; on the other hand, they were never public or documented classes in the first place, so I think we could do this.I lean towards that latter option; thoughts?