-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Remove old deprecated unittest features #89325
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The proposed PR removes the following unittest features:
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. |
Per https://mail.python.org/archives/list/python-dev@python.org/thread/GJTREADEXYAETECE5JDTPYWK4WMTKYGR/ 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. |
|
It is not a blocker at all. The changes were moved from 3.11 to 3.12. |
This commit replaces deprecated failIf calls with assertFalse in the test_resourced_test_case.py file. The failIf method was removed in Python 3.12 [1-3]. [1] https://docs.python.org/3.12/whatsnew/3.12.html#removed [2] python/cpython#89325 [3] python/cpython#28268 Signed-off-by: Petr Vaněk <arkamar@atlas.cz>
* Update unittest asserts to support Python 3.12+ Related to python/cpython#89325 * Update green.http.client for changes in Python 3.12 Related to python/cpython@f0b234e Co-Authored-By: Victor Stinner <vstinner@python.org> * Set green.thred.daemon_threads_allowed for Python 3.12+ support Related to python/cpython@4702552 * Python 3.12+ only: Adjust for removal of ssl.wrap_socket() Related to python/cpython@00464bb * Python 3.12 fixes by hroncok This PR attempts to add compatibility for older Python versions. We draw the line at Python versions that predate ssl.SSLContext, though. The remaining Python 2.7 documentation doesn't even mention the version at which that was introduced. * Allow access to global __ssl within class definition. * Remember whether original ssl module has wrap_socket() function. * Replace a few assertTrue() calls with assert statements. * In GreenSSLSocket.__new__(), use cls, not self. * Add 3.12 * Add newer versions * Warnings don't mean the test should fail * Fix syntax error * Style fixes * Simplify given we only support 3.8+ * Document 3.12 support --------- Co-authored-by: Miro Hrončok <miro@hroncok.cz> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Itamar Turner-Trauring <itamar@itamarst.org> Co-authored-by: Itamar Turner-Trauring <itamar@pythonspeed.com>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: