Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
bpo-5846: Deprecate obsolete methods inunittest
#28299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…tTestCaseNames in unittestScheduled for removal in Python 3.13
ReplacesGH-20400. |
I am working on a patch which gets rid of uses of obsolete functions. |
erlend-aasland commentedSep 12, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I had to adapt |
This reverts commitd978b17.
Sync with main bco.python#28303
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Are all tests warning-free?
If these functions are not used in unittest tests, add special tests, catch DeprecationWarning and check thefilename
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.
@@ -70,6 +70,37 @@ def testMultiply(self): | |||
# deprecated | |||
_TextTestResult = TextTestResult | |||
from .loader import ( | |||
makeSuite as _makeSuite, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Why not add deprecations when they are defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
IIUC, it is the "shortcuts" that are deprecated, not the methods themselves. Should I deprecate the undocumentedunittest.TestLoader.makeSuite
andunittest.TestLoader.findTestCases
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
There are nounittest.TestLoader.makeSuite
andunittest.TestLoader.findTestCases
.
erlend-aaslandSep 14, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Sorry, I meantunittest.loader
, notunittest.TestLoader
:
>>> import unittest>>> unittest.loader.makeSuite<function makeSuite at 0x10be0e2a0>>>> unittest.loader.findTestCases<function findTestCases at 0x10be0e340>>>>
Thanks for reviewing and merging,@serhiy-storchaka and@ambv! |
Seepython/cpython#28299loadTestsFromTestCase() is available since Python 2.7 at least.
Uh oh!
There was an error while loading.Please reload this page.
unittest.findTestCases
unittest.makeSuite
unittest.getTestCaseNames
Scheduled for removal in Python 3.13
https://bugs.python.org/issue5846