-
Notifications
You must be signed in to change notification settings - Fork 543
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gazelle): allow per-file py_test generation (#1563)
Previously the per-file target generation only worked for py_library targets. This change makes it so that this feature works for py_test targets as well. The change is careful to not affect any existing tests, so I'm not sure if it should count as a breaking change. New tests have been added to check the new functionality.
- Loading branch information
Showing
13 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions
3
gazelle/python/testdata/per_file_subdirs/test_target/BUILD.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
some_target( | ||
name = "__test__", | ||
) |
25 changes: 25 additions & 0 deletions
25
gazelle/python/testdata/per_file_subdirs/test_target/BUILD.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
load("@rules_python//python:defs.bzl", "py_test") | ||
|
||
some_target( | ||
name = "__test__", | ||
) | ||
|
||
py_test( | ||
name = "a_test", | ||
srcs = [ | ||
"a_test.py", | ||
":__test__", | ||
], | ||
main = ":__test__.py", | ||
deps = [":__test__"], | ||
) | ||
|
||
py_test( | ||
name = "b_test", | ||
srcs = [ | ||
"b_test.py", | ||
":__test__", | ||
], | ||
main = ":__test__.py", | ||
deps = [":__test__"], | ||
) |
Empty file.
Empty file.