potiuk commented on code in PR #44326:
URL: https://github.com/apache/airflow/pull/44326#discussion_r1859347754
##########
clients/python/test_python_client.py:
##########
@@ -63,68 +65,77 @@
# or AIRFLOW__CORE__LOAD_EXAMPLES environment variable set to True
DAG_ID = "example_bash_operator"
-# Enter a context with an instance of the API client
-with airflow_client.client.ApiClient(configuration) as api_client:
- errors = False
- print("[blue]Getting DAG list")
- dag_api_instance = dag_api.DAGApi(api_client)
- try:
- api_response = dag_api_instance.get_dags()
- print(api_response)
- except airflow_client.client.OpenApiException as e:
- print(f"[red]Exception when calling DagAPI->get_dags: {e}\n")
- errors = True
- else:
- print("[green]Getting DAG list successful")
+# Enter a context with an instance of the API client
Review Comment:
However there is one problem (small) with that. We are currently using
`test_python_client.py` as an executable script to run tests manually when
verifying the client.
See
https://github.com/apache/airflow/blob/main/dev/README_RELEASE_PYTHON_CLIENT.md#verify-the-release-candidate-by-contributors
So we should either instruct the users to use `pytest` to run those tests,
or turn it into runnable script (i.e. add
```python
if __name__ == "__main__":
test_python_client()
```
I think the second option is best.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]