You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/09/10 08:48:42 UTC

[GitHub] [airflow] Taragolis commented on issue #18125: Create pytest plugin for prepare test environment

Taragolis commented on issue #18125:
URL: https://github.com/apache/airflow/issues/18125#issuecomment-916741336


   Most probably my explanation not clear.
   I shouldn't have created it in midnight, I even wasn't  use my main account :-) 
   
   Let me explain wit some sample, probably after that my suggestion become more clear
   
   Fist of all, I've prepared some sample Gist with [simple plugin](https://gist.github.com/Taragolis/766c699f3f9a0065765bfedf5eacc633) for Airflow
   
   Main idea is just plugin which will able to install as regular package by pip - eg `pip install pytest-apache-airflow`
   At that moment internally it work with pytest key  `-p tests.plugins.airflow`
   
   >I think it would be a better idea to prepare a sample repository, which will contain example tests
   
   Yeah, It also nice. Based on to my past experience a lot of teams don't have any idea how even test integrity of dags and just try to deploy (shame, shame, shame)
   
   
   >We currently have documentation that describes how to configure connections and variables in tests. http://airflow.apache.org/docs/apache-airflow/stable/best-practices.html#mocking-variables-and-connections
   
   It also good documentation, and basically this should be used when you need redefine some variables in certain tests, not for global usage.
   
   My suggestion more about Global Environment Variables, which defined in conftest.py:
   https://github.com/apache/airflow/blob/e6cb2f7beb4c6ea4ad4a965f9c0f2b8f6978129c/tests/conftest.py#L32-L35
   
   


-- 
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