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/11/11 06:49:47 UTC

[GitHub] [airflow] uranusjr commented on issue #15525: Improve test coverage of views

uranusjr commented on issue #15525:
URL: https://github.com/apache/airflow/issues/15525#issuecomment-966035999


   To test a view, you need to set up a `Flask` app instance, and use it to invoke the views. Since setting up the `Flask` instance is quite costly, it’s important to reuse the instance as much as possible; in general we use Pytest’s [fixture scope](https://docs.pytest.org/en/stable/fixture.html#scope-sharing-fixtures-across-classes-modules-packages-or-session) for this; fixtures generating `Flask` instance would be marked either `module` or even `session` scoped so they can be reused by tests inside a `.py` file or for the entire `pytest` run. So it’d be very beneficial to first read and understand how Pytest fixtures, discoverer, and runner work. The test setup would make a lot more sense after that.


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