Skip to content

Fix wrong assertion methods in tests #37897

@Taragolis

Description

@Taragolis

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.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions