Skip to content
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

Refactor deprecated unittest aliases for Python 3.11 compatibility. #560

Merged
merged 1 commit into from
Oct 10, 2021
Merged

Refactor deprecated unittest aliases for Python 3.11 compatibility. #560

merged 1 commit into from
Oct 10, 2021

Conversation

tirkarthi
Copy link
Contributor

Ref : python/cpython#28268 . Aliases are present in Python 2.7 too. So the PR is backwards compatible and is a straightforward find and replace.

perl -pi -e 's/assertEquals/assertEqual/g' **/*py
perl -pi -e 's/failIf/assertFalse/g' **/*py
perl -pi -e 's/failUnless/assertTrue/g' **/*py

Command to find aliases :

rg -t py 'assertEquals|assertNotEquals|assertAlmostEquals|assertNotAlmostEquals|assertRegexpMatches|assertNotRegexpMatches|assertRaisesRegexp|failUnlessEqual|failIfEqual|failUnlessAlmostEqual|failUnless|failUnlessRaises|failIf'

@Legrandin Legrandin merged commit 28a2e8c into Legrandin:master Oct 10, 2021
@Legrandin
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants