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:
[email protected]


Reply via email to