Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
ambv merged 10 commits intopython:mainfromerlend-aasland:fix-issue-5846
Sep 15, 2021

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aaslanderlend-aasland commentedSep 12, 2021
edited by bedevere-bot
Loading

  • unittest.findTestCases
  • unittest.makeSuite
  • unittest.getTestCaseNames

Scheduled for removal in Python 3.13

https://bugs.python.org/issue5846

…tTestCaseNames in unittestScheduled for removal in Python 3.13
@erlend-aasland
Copy link
ContributorAuthor

ReplacesGH-20400.

@serhiy-storchaka
Copy link
Member

I am working on a patch which gets rid of uses of obsolete functions.

erlend-aasland reacted with thumbs up emoji

@erlend-aasland
Copy link
ContributorAuthor

erlend-aasland commentedSep 12, 2021
edited
Loading

I had to adapttest_support, since__module__ is nowunittest instead ofunittest.loader for these three functions.

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a 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).

erlend-aasland reacted with thumbs up emoji
@@ -70,6 +70,37 @@ def testMultiply(self):
# deprecated
_TextTestResult = TextTestResult

from .loader import (
makeSuite as _makeSuite,

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?

Copy link
ContributorAuthor

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?

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-aasland reacted with thumbs up emoji
Copy link
ContributorAuthor

@erlend-aaslanderlend-aaslandSep 14, 2021
edited
Loading

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>>>>

@ambvambv merged commitff6d2cc intopython:mainSep 15, 2021
@erlend-aaslanderlend-aasland deleted the fix-issue-5846 branchSeptember 15, 2021 18:34
@erlend-aasland
Copy link
ContributorAuthor

Thanks for reviewing and merging,@serhiy-storchaka and@ambv!

lazka added a commit to lazka/distutils that referenced this pull requestDec 27, 2021
Seepython/cpython#28299loadTestsFromTestCase() is available since Python 2.7 at least.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@erlend-aasland@serhiy-storchaka@ambv@the-knights-who-say-ni@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp