fix: make conftest.py special with gazelle - #879
Conversation
Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
| @@ -0,0 +1,12 @@ | |||
| import unittest | |||
There was a problem hiding this comment.
is the __test__.py file a gazelle convention that automatically becomes the test entrypoint, or is it generated? Reason I'm asking is this file name doesn't seem to match the allowed test patterns in generate, but gets included in the py_test sources.
There was a problem hiding this comment.
It's special for Gazelle. The following is the main logic (though they are used in some other places).
This allows the conftest.py to be used on sub-directories as pytest would pick them up. Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
|
Trying to upgrade from |
|
@ewhauser I just got one of these myself. I'm not sure yet what causes it, but if I clear the BUILD file and ask Gazelle to generate it again, it does the right thing. I'll work on a fix. |
|
Hi @f0rmiga. Any progress on a fix? Minimally, I feel like this feature should be documented in the top-level README. Perhaps, also add a flag to disable it if you want to handle As a future feature idea, it would be great if the generated |
conftest.pyis a special file that should be used only with tests, so we create apy_libraryfor it and add it as a dependency topy_test. By special-casing it, we take advantage of all the dependency resolution Gazelle offers. In contrast, when adding it to apy_testwith# keepand excluding it from Gazelle, we also have to manage its dependencies manually.