-
-
Notifications
You must be signed in to change notification settings - Fork 64
Description
What happened?
When using pytest_main = True on py_test, my test target cannot start with test_. If it does, I get E ModuleNotFoundError: No module named 'test_foo'. See #722 as a reproducer.
Version
Development (host) and target OS/architectures:
Output of bazel --version: 8.4.0 (version used in this repo)
Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file: main of this repo
Language(s) and/or frameworks involved:
How to reproduce
# Checkout https://github.com/aspect-build/rules_py/pull/722
bazel test //examples/pytest:test_fooAny other information?
Why is this important?
The simple answer is of course to just choose a different name for the targets. However, test_ is a very common pattern in Python for naming unit test files. Now if autogenerating the targets with gazelle, we would also expect to see a target with the same name which is not possible in this case.