classification
Title: Deprecate obsolete functions in unittest
Type: enhancement Stage: needs patch
Components: Library (Lib) Versions: Python 3.4
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: michael.foord Nosy List: ezio.melotti, georg.brandl, michael.foord
Priority: normal Keywords:

Created on 2009-04-25 23:44 by michael.foord, last changed 2012-09-26 17:29 by ezio.melotti.

Messages (5)
msg86574 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2009-04-25 23:44
_makeLoader, getTestCaseNames, makeSuite and findTestCases have all had
the comment "these functions should be considered obsolete" for a long time.

Is is ok to go straight to deprecation or should they be marked with
PendingDeprecationWarning first?
msg86687 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-04-27 17:08
I guess adding a standard DeprecationWarning is fine in these cases.
msg87298 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2009-05-05 23:00
So it turns out that unittest.makeSuite is used about 100 times
throughout the standard library tests.

More than half the time it can be replaced with
unittest.TestLoader().loadTestsFromTestCase(...)

Some of the other times a loader needs to be constructed and then a
testMethodPrefix of 'Check' set (yuck!).

I'm about halfway through a patch that does this. Think it is worth
continuing or shall I drop it. I don't mind doing it so long as
*someone* thinks it is worthwhile... :-)

(I haven't yet checked for getTestCaseNames but I imagine there will be
a bunch of these to fix as well.)

Another possibility is to move the functions into test_support
(deprecating first) where at least they are out of unittest.
msg87361 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-05-07 08:24
I'm sure Gerhard wouldn't say no to changing the sqlite3 test prefix to
"test_"...
msg87592 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2009-05-11 21:48
Hehe - I wasn't actually doing that, just replacing the use of the
obsolete functions.
History
Date User Action Args
2012-09-26 17:29:06ezio.melottisettype: enhancement
versions: + Python 3.4, - Python 3.3
2011-03-16 02:24:46ezio.melottisetstage: needs patch
versions: + Python 3.3, - Python 3.1, Python 2.7
2011-01-03 22:48:26ezio.melottisetnosy: + ezio.melotti
2009-05-11 21:48:40michael.foordsetmessages: + msg87592
2009-05-07 08:24:24georg.brandlsetmessages: + msg87361
2009-05-05 23:00:08michael.foordsetmessages: + msg87298
2009-04-27 17:08:35georg.brandlsetnosy: + georg.brandl
messages: + msg86687
2009-04-25 23:44:59michael.foordcreate