Why no __init__.py
in tests/unit/**
?
#11321
Answered
by
bryevdv
mattpap
asked this question in
Internals and design (Q&A)
-
I'm guessing this is intentional. This leads to relative imports like this: from _util_server import (
http_get,
url,
websocket_open,
ws_url,
) which then can't be statically typed (well, at least not straight and would require /cc @bryevdv |
Beta Was this translation helpful? Give feedback.
Answered by
bryevdv
Jun 4, 2021
Replies: 1 comment
-
See the discussion (especially towards the end of the section) here: https://docs.pytest.org/en/6.2.x/goodpractices.html#tests-outside-application-code TLDR; it is advised to use "src" directory layout of you add init files. I would like to move to src layout fwiw |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mattpap
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See the discussion (especially towards the end of the section) here:
https://docs.pytest.org/en/6.2.x/goodpractices.html#tests-outside-application-code
TLDR; it is advised to use "src" directory layout of you add init files. I would like to move to src layout fwiw