You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Taragolis (via GitHub)" <gi...@apache.org> on 2024/03/05 10:49:32 UTC
[I] Fix wrong assertion methods in tests [airflow]
Taragolis opened a new issue, #37897:
URL: https://github.com/apache/airflow/issues/37897
### Body
During the https://github.com/apache/airflow/pull/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](https://docs.astral.sh/ruff/rules/invalid-mock-access/#invalid-mock-access-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](https://github.com/apache/airflow/tree/main/airflow/providers/amazon)
- [ ] [`tests/providers/amazon/aws/operators/test_eks.py`](https://github.com/apache/airflow/blob/main/tests/providers/amazon/aws/operators/test_eks.py)
## Provider [microsoft.azure](https://github.com/apache/airflow/tree/main/airflow/providers/microsoft/azure)
- [ ] [`tests/providers/microsoft/azure/hooks/test_data_lake.py`](https://github.com/apache/airflow/blob/main/tests/providers/microsoft/azure/hooks/test_data_lake.py)
- [ ] [`tests/providers/microsoft/azure/hooks/test_cosmos.py`](https://github.com/apache/airflow/blob/main/tests/providers/microsoft/azure/hooks/test_cosmos.py)
- [ ] [`tests/providers/microsoft/azure/hooks/test_adx.py`](https://github.com/apache/airflow/blob/main/tests/providers/microsoft/azure/hooks/test_adx.py)
- [ ] [`tests/providers/microsoft/azure/hooks/test_data_factory.py`](https://github.com/apache/airflow/blob/main/tests/providers/microsoft/azure/hooks/test_data_factory.py)
- [ ] [`tests/providers/microsoft/azure/hooks/test_synapse.py`](https://github.com/apache/airflow/blob/main/tests/providers/microsoft/azure/hooks/test_synapse.py)
- [ ] [`tests/providers/microsoft/azure/hooks/test_wasb.py`](https://github.com/apache/airflow/blob/main/tests/providers/microsoft/azure/hooks/test_wasb.py)
## Provider [celery](https://github.com/apache/airflow/tree/main/airflow/providers/microsoft/celery)
- [ ] [`tests/providers/celery/executors/test_celery_executor.py`](https://github.com/apache/airflow/blob/main/tests/providers/microsoft/azure/hooks/test_celery_executor.py)
### Committer
- [X] I acknowledge that I am a maintainer/committer of the Apache Airflow project.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Fix wrong assertion methods in tests [airflow]
Posted by "xionams (via GitHub)" <gi...@apache.org>.
xionams commented on issue #37897:
URL: https://github.com/apache/airflow/issues/37897#issuecomment-1978686299
Hi, @Taragolis assign it to me
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Fix wrong assertion methods in tests [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed issue #37897: Fix wrong assertion methods in tests
URL: https://github.com/apache/airflow/issues/37897
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Fix wrong assertion methods in tests [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #37897:
URL: https://github.com/apache/airflow/issues/37897#issuecomment-1979836282
Assigned you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Fix wrong assertion methods in tests [airflow]
Posted by "alizademhdi (via GitHub)" <gi...@apache.org>.
alizademhdi commented on issue #37897:
URL: https://github.com/apache/airflow/issues/37897#issuecomment-1990971974
I think all of this tasks fixed in #36755 and #38025. So you can close this issue :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Fix wrong assertion methods in tests [airflow]
Posted by "alizademhdi (via GitHub)" <gi...@apache.org>.
alizademhdi commented on issue #37897:
URL: https://github.com/apache/airflow/issues/37897#issuecomment-1987378856
Hi @potiuk, I'm interested in doing the rest of the tasks. Can you assign it to me?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Fix wrong assertion methods in tests [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #37897:
URL: https://github.com/apache/airflow/issues/37897#issuecomment-1991113955
Yep. Python 3.12 caught all of them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org