Repository navigation
Use assertEqual instead of assertEquals, removed in Python 3.12 - #210
Open
FrimpsManu wants to merge 1 commit into
Open
FrimpsManu wants to merge 1 commit into
FrimpsManu wants to merge 1 commit into
Conversation
unittest removed the deprecated assertEquals alias in Python 3.12, so this test raises AttributeError there when the loadactionset call reports a problem. assertEqual is its documented replacement. The change was made with PatchAhead, a deterministic migration tool. Its other uses of old names in swat/utils/testing.py are compatibility wrappers (assertEqual falling back to assertEquals on old Pythons) and were deliberately left alone. Signed-off-by: Augustine Manu-Frimpong <150844417+FrimpsManu@users.noreply.github.com> Assisted-by: Claude Code
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
unittestremoved the deprecatedassertEqualsalias in Python 3.12, sotest_builtins.pyraisesAttributeErrorthere whenever theloadactionsetcall reports a problem.assertEqualis the documented replacement (Python 3.12 What's New).self.assertEqualhere goes through the compatibility wrapper inswat/utils/testing.py, which callsunittest.TestCase.assertEqual, so behaviour is unchanged on every Python version.How it was made: with PatchAhead, a deterministic migration tool, reading the
unittestsection of CPython's 3.12 release notes. It also found the old names inside the compatibility wrappers inswat/utils/testing.py(assertEqualfalling back toassertEquals, and so on) and deliberately left them alone, since rewriting them would make each wrapper call itself.Testing: this test needs a CAS server, which I don't have, so I couldn't run it. The change is the one-for-one rename Python documents, and the file compiles. This is a change to a test, so there's no separate unit test for it.
Use of AI tools: the change itself came from PatchAhead, which is deterministic. Claude Code (an AI assistant) helped me find the issue, run the tool, and write this commit and description. That's recorded as
Assisted-by: Claude Codein the commit.Contributor Agreement (from
ContributorAgreement.txt), accepted with the sign-off in the commitSigned-off-by: Augustine Manu-Frimpong 150844417+FrimpsManu@users.noreply.github.com