GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-5846: Deprecate obsolete methods in `unittest` by erlend-aasland · Pull Request #28299 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented Sep 12, 2021 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • unittest.findTestCases
  • unittest.makeSuite
  • unittest.getTestCaseNames

Scheduled for removal in Python 3.13

https://bugs.python.org/issue5846

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Erlend E. Aasland
bpo-5846: Deprecate obsolete methods makeSuite, findTestCases, and ge…
c296189
…tTestCaseNames in unittest

Scheduled for removal in Python 3.13
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Sep 12, 2021
@bedevere-bot bedevere-bot added the awaiting review label Sep 12, 2021
@erlend-aasland

erlend-aasland commented Sep 12, 2021

Copy link
Copy Markdown
Contributor Author

Replaces GH-20400.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland erlend-aasland mentioned this pull request Sep 12, 2021
bpo-5846: Deprecate obsolete methods makeSuite, findTestCases, and getTestCaseNames in unittest #20400
Closed
@serhiy-storchaka

serhiy-storchaka commented Sep 12, 2021

Copy link
Copy Markdown
Member

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

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Erlend E. Aasland added 4 commits September 13, 2021 00:26
Erlend E. Aasland
Address Serhiy's review
f44aff7
Erlend E. Aasland
Remove incorrect doc update
497e842
Erlend E. Aasland
Improve NEWS/What's New wording
d692851
Erlend E. Aasland
Fix test_support
dfd6fac
@erlend-aasland
erlend-aasland requested a review from serhiy-storchaka September 12, 2021 22:43
@erlend-aasland

erlend-aasland commented Sep 12, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

I had to adapt test_support, since __module__ is now unittest instead of unittest.loader for these three functions.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Erlend E. Aasland added 3 commits September 13, 2021 00:58
Erlend E. Aasland
Use default shared loader
d978b17
Erlend E. Aasland
Revert "Use default shared loader"
56aa986
This reverts commit d978b17.
Erlend E. Aasland
Merge branch 'main' into fix-issue-5846
db40a08
Sync with main bco. python#28303
serhiy-storchaka
serhiy-storchaka reviewed Sep 13, 2021
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

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 the filename attribute (to ensure that the stacklevel is correct).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Doc/whatsnew/3.11.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_support.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/unittest/__init__.py
_TextTestResult = TextTestResult

from .loader import (
makeSuite as _makeSuite,

@serhiy-storchaka serhiy-storchaka Sep 13, 2021

Copy link
Copy Markdown
Member

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@erlend-aasland erlend-aasland Sep 13, 2021

Copy link
Copy Markdown
Contributor Author

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 undocumented unittest.TestLoader.makeSuite and unittest.TestLoader.findTestCases as well?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@serhiy-storchaka serhiy-storchaka Sep 13, 2021

Copy link
Copy Markdown
Member

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 no unittest.TestLoader.makeSuite and unittest.TestLoader.findTestCases.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@erlend-aasland erlend-aasland Sep 14, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

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 meant unittest.loader, not unittest.TestLoader:

>>> import unittest
>>> unittest.loader.makeSuite
<function makeSuite at 0x10be0e2a0>
>>> unittest.loader.findTestCases
<function findTestCases at 0x10be0e340>
>>> 

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Erlend E. Aasland added 2 commits September 13, 2021 10:57
Erlend E. Aasland
Address review
48741cb
Erlend E. Aasland
Merge remote-tracking branch 'main' into fix-issue-5846
fa28304
@ambv
ambv merged commit ff6d2cc into python:main Sep 15, 2021
@bedevere-bot bedevere-bot removed the awaiting review label Sep 15, 2021
@erlend-aasland
erlend-aasland deleted the fix-issue-5846 branch September 15, 2021 18:34
@erlend-aasland

erlend-aasland commented Sep 15, 2021

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lazka added a commit to lazka/distutils that referenced this pull request Dec 27, 2021
@lazka
tests: use loadTestsFromTestCase() instead of the deprecated makeSuite()
9c4d48c
See python/cpython#28299

loadTestsFromTestCase() is available since Python 2.7 at least.
@lazka lazka mentioned this pull request Dec 27, 2021
tests: use loadTestsFromTestCase() instead of the deprecated makeSuite() pypa/distutils#94
Merged
@voidspace voidspace mentioned this pull request May 24, 2023
Deprecate obsolete functions in unittest #50096
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@serhiy-storchaka serhiy-storchaka serhiy-storchaka left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@erlend-aasland @serhiy-storchaka @ambv @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.