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-45162: Remove many old deprecated unittest features#28268

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

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedSep 10, 2021
edited by bedevere-bot
Loading

  • "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.

https://bugs.python.org/issue45162

* "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.
@ambvambv added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelSep 10, 2021
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@ambv for commit2d96fb9 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelSep 10, 2021
@ambvambv self-requested a reviewSeptember 12, 2021 16:18
@erlend-aasland
Copy link
Contributor

See alsoGH-20400. Should I reopen?

@serhiy-storchaka
Copy link
MemberAuthor

I do not know whyGH-20400 was closed. Seems there were no objections against it.

But many of these functions are still used in Python tests, so we should first clean up tests from them. Also, we need to research how often they are used in third-party code. The deprecation period can be prolonged if there are many occurrences. All features removed in this PR were deprecated for at least 6 releases.

@erlend-aasland
Copy link
Contributor

I do not know whyGH-20400 was closed. Seems there were no objections against it.

I closed it because I got no response, and I had enough to do already with my sqlite3 PR's :)

Also, we need to research how often they are used in third-party code. The deprecation period can be prolonged if there are many occurrences. All features removed in this PR were deprecated for at least 6 releases.

Absolutely.

@serhiy-storchakaserhiy-storchaka merged commitb0a6ede intopython:mainSep 17, 2021
@serhiy-storchakaserhiy-storchaka deleted the unittest-remove-deprecated branchSeptember 17, 2021 10:33
This was referencedOct 4, 2021
gpshead added a commit to gpshead/cpython that referenced this pull requestJan 26, 2022
…onGH-28268)"This reverts commitb0a6ede.We're deferring this change until 3.12 while upstream projects that usethe legacy assertion method names are fixed.  See the issue for linksto the discussion.
gpshead added a commit that referenced this pull requestJan 27, 2022
…30935)Revert "bpo-45162: Remove many old deprecated unittest features (GH-28268)"This reverts commitb0a6ede.We're deferring this change until 3.12 while upstream projects that usethe legacy assertion method names are fixed.  See the issue for linksto the discussion. Many upstream projects now have issues and PRsfiled.
arkamar added a commit to arkamar/testresources that referenced this pull requestMay 31, 2023
This commit replaces deprecated failIf calls with assertFalse in thetest_resourced_test_case.py file. The failIf method was removed inPython 3.12 [1-3].[1]https://docs.python.org/3.12/whatsnew/3.12.html#removed[2]python/cpython#89325[3]python/cpython#28268Signed-off-by: Petr Vaněk <arkamar@atlas.cz>
@konnectrkonnectr mentioned this pull requestAug 1, 2023
10 tasks
parthea added a commit to googleapis/python-storage that referenced this pull requestNov 29, 2023
cojenco added a commit to googleapis/python-storage that referenced this pull requestDec 1, 2023
* chore(python): Add Python 3.12Source-Link:googleapis/synthtool@af16e6dPost-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:bacc3af03bff793a03add584537b36b5644342931ad989e3ba1171d3bd5399f5* Add trove classifier for python 3.12* Update contributing.rst, noxfile and constraints to include python 3.12* remove usage of deprecated assertDictContainsSubsetpython/cpython#28268* update tests KMS key settings---------Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>Co-authored-by: Anthonios Partheniou <partheniou@google.com>Co-authored-by: Cathy Ouyang <cathyo@google.com>
Silvanoc added a commit to linkml/linkml-runtime that referenced this pull requestJan 30, 2024
Unittest method "assertEquals" is deprecated since Python 3.1, but wasstill present in the code.The deprecated method was removed with bpo-45162 [1] and merged on 3.11.[1]:python/cpython#28268Signed-off-by: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>
Silvanoc added a commit to linkml/linkml-runtime that referenced this pull requestJan 30, 2024
Unittest method "assertEquals" is deprecated since Python 3.1, but wasstill present in the code.The deprecated method was removed with bpo-45162 [1] and merged on 3.11.[1]:python/cpython#28268Signed-off-by: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>
Silvanoc added a commit to linkml/linkml-runtime that referenced this pull requestJan 30, 2024
Unittest method "assertEquals" is deprecated since Python 3.1, but wasstill present in the code.The deprecated method was removed with bpo-45162 [1] and merged on 3.11.[1]:python/cpython#28268Signed-off-by: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>
Silvanoc added a commit to linkml/linkml-runtime that referenced this pull requestJan 30, 2024
Unittest method "assertEquals" is deprecated since Python 3.1, but wasstill present in the code.The deprecated method was removed with bpo-45162 [1] and merged on 3.11.[1]:python/cpython#28268Signed-off-by: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>
facebook-github-bot pushed a commit to facebook/openbmc that referenced this pull requestFeb 1, 2024
Summary:assertEquals used to be an alias to assertEqual, but seems the aliases were removed:python/cpython#28268This is causing some tests to fail with```======================================================================ERROR: test_set_all_fans_and_read (tests.grandcanyon.test_fans.FansTest.test_set_all_fans_and_read)Test setting all fans speed and read to ensure it is the same----------------------------------------------------------------------Traceback (most recent call last):  File "/run/tests2/common/base_fans_test.py", line 362, in test_set_all_fans_and_read    speed = self.get_speed(data)            ^^^^^^^^^^^^^^^^^^^^  File "/run/tests2/common/base_fans_test.py", line 287, in get_speed    self.assertEquals(num, self.names[m.group(1)], "Bad fan index")    ^^^^^^^^^^^^^^^^^AttributeError: 'FansTest' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?```Test Plan:Test run on grandcanyon```$ netcastle --team openbmc --platform grandcanyonRan 90 tests in 39 mins 54.908 secs[   ERROR] 0[  FAILED] 0[ TIMEOUT] 0[  PASSED] 70[ SKIPPED] 20[ OMITTED] 0[ RETRIED] 02024/02/01 02:36:52.896|522087|MainThread|I|abstract_runner: All tests passed!Reviewed By: lsiudutDifferential Revision: D53307151fbshipit-source-id: 163ef91fd883ca607f6bfdb0b10e756015957e74
Silvanoc added a commit to linkml/linkml-runtime that referenced this pull requestFeb 13, 2024
Unittest method "assertEquals" is deprecated since Python 3.1, but wasstill present in the code.The deprecated method was removed with bpo-45162 [1] and merged on 3.11.[1]:python/cpython#28268Signed-off-by: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>
@jiasli
Copy link
Contributor

jiasli commentedJul 15, 2024
edited
Loading

@tirkarthi, what is the best drop-in replacement forassertDictContainsSubset?https://stackoverflow.com/a/19221301/2199657 mentioned:

Drop in replacement is to useassertLessEqual and.items() on the dicts.

That is:

- self.assertDictContainsSubset(a, b)+ self.assertLessEqual(a.items(), b.items())

twilio/twilio-python#636 andtensorflow/tfx@010e94d adopted different approaches. What is Python's official recommendation?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ambvambvAwaiting requested review from ambv

Assignees
No one assigned
Labels
type-featureA feature request or enhancement
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

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

[8]ページ先頭

©2009-2025 Movatter.jp