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.

Title: Remove old deprecated unittest features
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.11
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ezio.melotti, gregory.p.smith, michael.foord, rbcollins, serhiy.storchaka
Priority: deferred blocker Keywords: patch

Created on 2021-09-10 10:15 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 28268 merged serhiy.storchaka, 2021-09-10 10:23
PR 30935 merged gregory.p.smith, 2022-01-27 00:00
Messages (4)
msg401568 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-09-10 10:15
The proposed PR removes the following unittest features:

* "fail*" and "assert*" aliases of TestCase methods.
* Broken from start TestCase method assertDictContainsSubset().
* Ignored TestLoader.loadTestsFromModule() parameter use_load_tests.
* Old alias _TextTestResult of TextTestResult.

Most features were deprecated in 3.2, "fail*" methods in 3.1, assertNotRegexpMatches in 3.5. They were kept mostly for compatibility with 2.7 (although some of them were new in Python 3 and not compatible with 2.7).

Using deprecated assertEquals instead of assertEqual is a common error which we need to fix regularly, so removing deprecated features will not only make the current code clearer, but save as from future errors.
msg402033 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-09-17 10:33
New changeset b0a6ede3d0bd6fa4ffe413ab4dfc1059201df25b by Serhiy Storchaka in branch 'main':
bpo-45162: Remove many old deprecated unittest features (GH-28268)
msg411808 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2022-01-26 23:28
Per we want to revert this change for 3.11 as it causes adoption pain for little benefit.

To determine if we should proceed with this in 3.12 or future versions, run a stable Python with this change applied on the test suites of external projects to find regressions.  (many will have been addressed by then thanks to the work by RedHat)

and remember that those are only open source projects. Peoples internal codebases are full of use of these names and this will prevent upgrading until they take the time to address those.

There are targeted pieces of this change that may make sense to go forward with individually.  But it is easier to reason about after a rollback and consider new PRs to move those forward.
msg411838 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2022-01-27 04:39
New changeset b50322d20337ca468f2070eedb051a16ee1eba94 by Gregory P. Smith in branch 'main':
bpo-45162: Revert "Remove many old deprecated unittest features" (GH-30935)
Date User Action Args
2022-04-11 14:59:49adminsetgithub: 89325
2022-01-27 04:40:24gregory.p.smithsetassignee: gregory.p.smith ->
2022-01-27 04:39:27gregory.p.smithsetmessages: + msg411838
2022-01-27 00:00:50gregory.p.smithsetstage: needs patch -> patch review
pull_requests: + pull_request29114
2022-01-26 23:36:22gregory.p.smithsetassignee: gregory.p.smith
2022-01-26 23:28:35gregory.p.smithsetstatus: closed -> open
priority: normal -> deferred blocker
type: enhancement -> behavior

nosy: + gregory.p.smith
messages: + msg411808
resolution: fixed ->
stage: resolved -> needs patch
2021-09-17 10:33:58serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-09-17 10:33:32serhiy.storchakasetmessages: + msg402033
2021-09-10 10:23:10serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request26688
2021-09-10 10:17:22serhiy.storchakasetnosy: + rbcollins, ezio.melotti, michael.foord
2021-09-10 10:15:06serhiy.storchakacreate