This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2009年04月25日 23:44 by michael.foord, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 20400 | closed | erlendaasland, 2020年05月25日 21:56 | |
| PR 28299 | merged | erlendaasland, 2021年09月12日 21:14 | |
| PR 28303 | merged | serhiy.storchaka, 2021年09月13日 06:16 | |
| PR 28382 | merged | serhiy.storchaka, 2021年09月16日 08:27 | |
| Messages (13) | |||
|---|---|---|---|
| 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. |
|||
| msg386705 - (view) | Author: Erlend E. Aasland (erlendaasland) * (Python triager) | 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) * (Python committer) | 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) * (Python committer) | 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) * (Python committer) | 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) * (Python committer) | 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) * (Python triager) | 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) * (Python committer) | Date: 2021年09月17日 11:54 | |
It is an internal function. We can remove it without deprecation. |
|||
| msg402126 - (view) | Author: Erlend E. Aasland (erlendaasland) * (Python triager) | Date: 2021年09月18日 12:12 | |
> It is an internal function. We can remove it without deprecation. How convenient :) |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:48 | admin | set | github: 50096 |
| 2021年09月18日 12:12:58 | erlendaasland | set | messages: + msg402126 |
| 2021年09月17日 11:54:09 | serhiy.storchaka | set | messages: + msg402042 |
| 2021年09月17日 09:13:12 | erlendaasland | set | messages: + msg402016 |
| 2021年09月17日 09:11:48 | serhiy.storchaka | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2021年09月17日 09:10:06 | serhiy.storchaka | set | versions: + Python 3.11, - Python 3.4 |
| 2021年09月17日 09:09:36 | serhiy.storchaka | set | messages: + msg402014 |
| 2021年09月16日 08:27:20 | serhiy.storchaka | set | pull_requests: + pull_request26797 |
| 2021年09月15日 19:50:36 | serhiy.storchaka | set | messages: + msg401899 |
| 2021年09月15日 18:34:09 | lukasz.langa | set | nosy:
+ lukasz.langa messages: + msg401878 |
| 2021年09月13日 07:49:57 | serhiy.storchaka | set | messages: + msg401691 |
| 2021年09月13日 06:16:57 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka pull_requests: + pull_request26717 |
| 2021年09月12日 21:14:28 | erlendaasland | set | pull_requests: + pull_request26713 |
| 2021年02月09日 10:45:14 | erlendaasland | set | messages: + msg386705 |
| 2020年05月25日 21:56:49 | erlendaasland | set | keywords:
+ patch nosy: + erlendaasland pull_requests: + pull_request19663 stage: needs patch -> patch review |
| 2012年09月26日 17:29:06 | ezio.melotti | set | type: enhancement versions: + Python 3.4, - Python 3.3 |
| 2011年03月16日 02:24:46 | ezio.melotti | set | stage: needs patch versions: + Python 3.3, - Python 3.1, Python 2.7 |
| 2011年01月03日 22:48:26 | ezio.melotti | set | nosy:
+ ezio.melotti |
| 2009年05月11日 21:48:40 | michael.foord | set | messages: + msg87592 |
| 2009年05月07日 08:24:24 | georg.brandl | set | messages: + msg87361 |
| 2009年05月05日 23:00:08 | michael.foord | set | messages: + msg87298 |
| 2009年04月27日 17:08:35 | georg.brandl | set | nosy:
+ georg.brandl messages: + msg86687 |
| 2009年04月25日 23:44:59 | michael.foord | create | |