Uh oh!
There was an error while loading. Please reload this page.
bpo-5846: Deprecate obsolete methods in unittest - #28299
Conversation
…tTestCaseNames in unittest Scheduled for removal in Python 3.13
erlend-aasland
commented
Sep 12, 2021
Replaces GH-20400. |
serhiy-storchaka
commented
Sep 12, 2021
I am working on a patch which gets rid of uses of obsolete functions. |
I had to adapt |
This reverts commit d978b17.
Sync with main bco. python#28303
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Are all tests warning-free?
If these functions are not used in unittest tests, add special tests, catch DeprecationWarning and check the filename attribute (to ensure that the stacklevel is correct).
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| _TextTestResult = TextTestResult | ||
| from .loader import ( | ||
| makeSuite as _makeSuite, |
There was a problem hiding this comment.
Why not add deprecations when they are defined?
There was a problem hiding this comment.
IIUC, it is the "shortcuts" that are deprecated, not the methods themselves. Should I deprecate the undocumented unittest.TestLoader.makeSuite and unittest.TestLoader.findTestCases as well?
There was a problem hiding this comment.
There are no unittest.TestLoader.makeSuite and unittest.TestLoader.findTestCases.
There was a problem hiding this comment.
Sorry, I meant unittest.loader, not unittest.TestLoader:
>>> import unittest
>>> unittest.loader.makeSuite
<function makeSuite at 0x10be0e2a0>
>>> unittest.loader.findTestCases
<function findTestCases at 0x10be0e340>
>>> erlend-aasland
commented
Sep 15, 2021
Thanks for reviewing and merging, @serhiy-storchaka and @ambv! |
See python/cpython#28299 loadTestsFromTestCase() is available since Python 2.7 at least.
unittest.findTestCasesunittest.makeSuiteunittest.getTestCaseNamesScheduled for removal in Python 3.13
https://bugs.python.org/issue5846