Skip to content

Check mock assertion methods#37874

Merged
Taragolis merged 3 commits intoapache:mainfrom
Taragolis:validate-uninttest-mock-methods
Mar 5, 2024
Merged

Check mock assertion methods#37874
Taragolis merged 3 commits intoapache:mainfrom
Taragolis:validate-uninttest-mock-methods

Conversation

@Taragolis
Copy link
Contributor

That is pretty common mistake to use assert on non-existed unittest.mock.Mock methods.
PGH005 might help to validate this methods, one downside is that it have false positive in some specific cases, see: astral-sh/ruff#10223 , this PR also cover this case

During the enable rule, I've found that some of the tests broken, maybe even initially or some kind of regression happen during the time.
I've marked this tests with noqa: PGH005 and have a plan to create a task for fix it


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@Taragolis Taragolis added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Mar 4, 2024
@Taragolis Taragolis merged commit b541f55 into apache:main Mar 5, 2024
@Taragolis Taragolis deleted the validate-uninttest-mock-methods branch March 5, 2024 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) provider:amazon AWS/Amazon - related issues provider:apache-druid provider:celery provider:cncf-kubernetes Kubernetes (k8s) provider related issues provider:fab provider:microsoft-azure Azure-related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants