Skip to content

#12451 Resolve warnings of testing library - #12450

Merged
adiroiban merged 3 commits into
twisted:trunkfrom
emmanuel-ferdman:trunk
May 16, 2025
Merged

adiroiban merged 3 commits into
twisted:trunkfrom
emmanuel-ferdman:trunk

Conversation

@emmanuel-ferdman

@emmanuel-ferdman emmanuel-ferdman commented May 12, 2025 •

Copy link
Copy Markdown
Contributor

Scope and purpose

Fixes #12451

As its written in the test-standard, this PR migrates from unittest.assertEquals to unittest.assertEqual which is deprecated from Python2.7:

DeprecationWarning: Please use assertEqual instead.

@codspeed

codspeed Bot commented May 12, 2025 •

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #12450 will not alter performance

Comparing emmanuel-ferdman:trunk (dd86294) with trunk (ab7970a)

Summary

✅ 36 untouched benchmarks

@adiroiban adiroiban changed the title resolve warnings of testing library #12451 Resolve warnings of testing library May 12, 2025
@adiroiban

Copy link
Copy Markdown
Member

Thanks for the PR. Much appreciated.

I have created a dedicated ticket and release notes placehoder to get all our automated tests / checks pass and be ready to land this


Just asking:

Is there any way in which we can prevent regressions in the future ?

What is stoping a developer to introduce code in the future PR that uses unittest.assertEquals ?

@adiroiban

Copy link
Copy Markdown
Member

We have this ticket #6348 and maybe we can do some work there.

Of couse, this can be merged as part of the cleanup work

@adiroiban

Copy link
Copy Markdown
Member

I guess that we can get this reviewed and merge

even if we can't prevent regressions, this is better than what we have in trunk

needs-review

@chevah-robot
chevah-robot requested a review from a team May 15, 2025 15:19
@glyph

glyph commented May 15, 2025

Copy link
Copy Markdown
Member

We should run the tests with -Werror or some similar (maybe trial could have a flag for this) but we can definitely land some progress even if some backsliding does occur

@adiroiban adiroiban left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

It looks good.
It should help prevent accidentaly copy/paste errors when writing new tests

we should look into a permanent solution to automatically detect deprecation warnings ... but that can be done in a separate ticket/PR

Thanks again

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resolve warnings of testing library

4 participants