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/04/11 14:30:22 UTC

[GitHub] [airflow] uranusjr commented on pull request #15317: Delete chart/tests/__init__.py

uranusjr commented on pull request #15317:
URL: https://github.com/apache/airflow/pull/15317#issuecomment-817317151


   Pytest by default does *not* load a `tests` directory without a `__init__.py` as a namespace package; it has its own module identification logic. This is also why I chanced the `helm_template_generator` imports—by removing the `__init__.py` file, the whole `tests` directory is no longer considered a package (neither namespace nor regular) by pytest.
   
   But if you’re really against removing the file, maybe we can change how pytest loads tests instead, with the new `importlib` strategy introduced in pytest 6.0. I actually just learned about this right now myself as well. Pytest traditionally expects users to put tests in plain directories (not packages) and had a lot of issues dealing with the `__init__.py` files in the tests directory (and thus strongly *discouraged* the setup)), but seems to have become better with it.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org