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

Fix wrong assertion methods in tests #37897

Closed
9 tasks done
Taragolis opened this issue Mar 5, 2024 · 5 comments
Closed
9 tasks done

Fix wrong assertion methods in tests #37897

Taragolis opened this issue Mar 5, 2024 · 5 comments
Assignees
Labels
good first issue kind:meta High-level information important to the community

Comments

@Taragolis
Copy link
Contributor

Taragolis commented Mar 5, 2024

Body

During the #37874 we starts to check invalid usage of unittest.mock.Mock methods, e.g.
usage of assert <mocked_object>.called_once which always evaluated as True instead of correct one <mocked_object>.assert_called_once().

Unfortunetly not all tests are worked after changes:

  • regression
  • changes in code base not reflected in tests
  • comparison with new objects which do not implements __eq__
  • etc.

All assert which are do not pass PGH005 rule has # noqa: PGH005 (fixme: WHAT HAPPEN IF CHANGE TO METHOD), this should be resolved.

There is no single rule how it should be done, because it might involve to fix in Airflow codebase rather than in tests.

Provider amazon

Provider microsoft.azure

Provider celery

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.
@Taragolis Taragolis added kind:meta High-level information important to the community good first issue labels Mar 5, 2024
@xionams
Copy link
Contributor

xionams commented Mar 5, 2024

Hi, @Taragolis assign it to me

@potiuk
Copy link
Member

potiuk commented Mar 5, 2024

Assigned you.

@alizmhdi
Copy link
Contributor

Hi @potiuk, I'm interested in doing the rest of the tasks. Can you assign it to me?

@alizmhdi
Copy link
Contributor

I think all of this tasks fixed in #36755 and #38025. So you can close this issue :)

@potiuk
Copy link
Member

potiuk commented Mar 12, 2024

Yep. Python 3.12 caught all of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue kind:meta High-level information important to the community
Projects
None yet
Development

No branches or pull requests

4 participants