Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/pytest/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ py_library(
)

py_test(
name = "pytest_test",
name = "test_pytest_test",
srcs = ["foo_test.py"],
data = glob([
"fixtures/*.json",
Expand Down
3 changes: 2 additions & 1 deletion py/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ def py_test(name, srcs = [], main = None, pytest_main = False, **kwargs):
if pytest_main:
if main:
fail("When pytest_main is set, the main attribute should not be set.")
pytest_main_target = name + ".pytest_main"
# Add a prefix to the test main to ensure targets called "test_*" do not get discovered by pytest.
pytest_main_target = "zzz_" + name + ".pytest_main"
main = pytest_main_target + ".py"
py_pytest_main(name = pytest_main_target)
srcs.append(main)
Expand Down
Loading