msg86574 - (view) |
Author: Michael Foord (michael.foord) *  |
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) *  |
Date: 2009-04-27 17:08 |
I guess adding a standard DeprecationWarning is fine in these cases. |
|
|
msg87298 - (view) |
Author: Michael Foord (michael.foord) *  |
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) *  |
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) *  |
Date: 2009-05-11 21:48 |
Hehe - I wasn't actually doing that, just replacing the use of the obsolete functions. |
|
|
msg386705 - (view) |
Author: Erlend E. Aasland (erlendaasland) *  |
Date: 2021-02-09 10:45 |
> I'm sure Gerhard wouldn't say no to changing the sqlite3 test prefix to "test_"... FYI, the sqlite3 tests have now been cleaned up (GH-20538). Remaining occurrences in Lib/test: Lib/test/test_pdb.py: unittest.makeSuite(PdbTestCase), Lib/test/test_dbm.py: suites = [unittest.makeSuite(c) for c in classes] Lib/test/test_io.py: suite = unittest.TestSuite([unittest.makeSuite(test) for test in tests]) Lib/test/test_threading_local.py: suite.addTest(unittest.makeSuite(ThreadLocalTest)) Lib/test/test_threading_local.py: suite.addTest(unittest.makeSuite(PyThreadingLocalTest)) Lib/test/test_zipimport.py: # item in a list sorted by name, like unittest.makeSuite() does.) Lib/test/support/__init__.py: suite.addTest(unittest.findTestCases(sys.modules[cls])) Lib/test/support/__init__.py: suite.addTest(unittest.makeSuite(cls)) Lib/test/support/testresult.py: suite.addTest(unittest.makeSuite(TestTests)) Lib/test/test_email/torture_test.py: suite.addTest(unittest.makeSuite(testclass)) Lib/test/test_math.py: suite.addTest(unittest.makeSuite(MathTests)) Lib/test/test_math.py: suite.addTest(unittest.makeSuite(IsCloseTests)) |
|
|
msg401691 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2021-09-13 07:49 |
New changeset 851811f5772c43f72f445e2ce1ac3ea9da951ae3 by Serhiy Storchaka in branch 'main': bpo-5846: Do not use obsolete unittest functions. (GH-28303) https://github.com/python/cpython/commit/851811f5772c43f72f445e2ce1ac3ea9da951ae3 |
|
|
msg401878 - (view) |
Author: Ćukasz Langa (lukasz.langa) *  |
Date: 2021-09-15 18:34 |
New changeset ff6d2cc55aac5cc53e331cae145d0cf35ec647b0 by Erlend Egeberg Aasland in branch 'main': bpo-5846: Deprecate obsolete methods in `unittest` (GH-28299) https://github.com/python/cpython/commit/ff6d2cc55aac5cc53e331cae145d0cf35ec647b0 |
|
|
msg401899 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2021-09-15 19:50 |
I do not think that PR 28299 is correct. We want to deprecate these functions which are implemented in the unittest.loader module, not just names exported to the unittest module. |
|
|
msg402014 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2021-09-17 09:09 |
New changeset b2b035a949eff1dc54b5bafe2bc9ce72b4d24438 by Serhiy Storchaka in branch 'main': bpo-5846: Fix deprecations for obsolete unittest functions and add tests. (GH-28382) https://github.com/python/cpython/commit/b2b035a949eff1dc54b5bafe2bc9ce72b4d24438 |
|
|
msg402016 - (view) |
Author: Erlend E. Aasland (erlendaasland) *  |
Date: 2021-09-17 09:13 |
_makeLoader is not deprecated yet, so we might keep this open a little bit more. |
|
|
msg402042 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2021-09-17 11:54 |
It is an internal function. We can remove it without deprecation. |
|
|
msg402126 - (view) |
Author: Erlend E. Aasland (erlendaasland) *  |
Date: 2021-09-18 12:12 |
> It is an internal function. We can remove it without deprecation. How convenient :) |
|
|